MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / regExpVariableFilter

Function regExpVariableFilter

dql/parser.go:533–546  ·  view source on GitHub ↗
(f *Function, idx int)

Source from the content-addressed store, hash-verified

531}
532
533func regExpVariableFilter(f *Function, idx int) error {
534 // Value should have been populated from the map that the user gave us in the
535 // DQL variable map. Let's parse the expression and flags from the variable
536 // string.
537 ra, err := parseRegexArgs(f.Args[idx].Value)
538 if err != nil {
539 return err
540 }
541 // We modify the value of this arg and add a new arg for the flags. Regex functions
542 // should have two args.
543 f.Args[idx].Value = ra.expr
544 f.Args = append(f.Args, Arg{Value: ra.flags})
545 return nil
546}
547
548func substituteVariablesFilter(f *FilterTree, vmap varMap) error {
549 if f == nil {

Callers 2

substituteVariablesFunction · 0.85

Calls 1

parseRegexArgsFunction · 0.85

Tested by

no test coverage detected