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

Method PatchAndCheck

checker/checker.go:72–82  ·  view source on GitHub ↗

PatchAndCheck applies all patchers and checks the tree.

(tree *parser.Tree, config *conf.Config)

Source from the content-addressed store, hash-verified

70
71// PatchAndCheck applies all patchers and checks the tree.
72func (v *Checker) PatchAndCheck(tree *parser.Tree, config *conf.Config) (reflect.Type, error) {
73 v.reset(config)
74 if len(config.Visitors) > 0 {
75 // Run all patchers that dont support being run repeatedly first
76 v.runVisitors(tree, false)
77
78 // Run patchers that require multiple passes next (currently only Operator patching)
79 v.runVisitors(tree, true)
80 }
81 return v.Check(tree, config)
82}
83
84// Check checks types of the expression tree. It returns type of the expression
85// and error if any. If config is nil, then default configuration will be used.

Callers 2

ParseCheckFunction · 0.80
TestIssue844Function · 0.80

Implementers 3

Configconf/config.go
Checkerchecker/checker.go
OperatorOverloadingpatcher/operator_override.go

Calls 3

resetMethod · 0.95
runVisitorsMethod · 0.95
CheckMethod · 0.95

Tested by 1

TestIssue844Function · 0.64