MCPcopy
hub / github.com/expr-lang/expr / ParseCheck

Function ParseCheck

checker/checker.go:34–46  ·  view source on GitHub ↗

ParseCheck parses input expression and checks its types. Also, it applies all provided patchers. In case of error, it returns error with a tree.

(input string, config *conf.Config)

Source from the content-addressed store, hash-verified

32// ParseCheck parses input expression and checks its types. Also, it applies
33// all provided patchers. In case of error, it returns error with a tree.
34func ParseCheck(input string, config *conf.Config) (*parser.Tree, error) {
35 tree, err := parser.ParseWithConfig(input, config)
36 if err != nil {
37 return tree, err
38 }
39
40 _, err = new(Checker).PatchAndCheck(tree, config)
41 if err != nil {
42 return tree, err
43 }
44
45 return tree, nil
46}
47
48// Check calls Check on a disposable Checker.
49func Check(tree *parser.Tree, config *conf.Config) (reflect.Type, error) {

Callers 3

CompileFunction · 0.92
BenchmarkVMFunction · 0.92

Calls 2

ParseWithConfigFunction · 0.92
PatchAndCheckMethod · 0.80

Tested by 2

BenchmarkVMFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…