MCPcopy Create free account
hub / github.com/cel-expr/cel-go / IsLocalVariable

Method IsLocalVariable

interpreter/interpretable.go:1648–1665  ·  view source on GitHub ↗

IsLocalVariable reports whether the variable name is locally bound by the folder scope.

(name string)

Source from the content-addressed store, hash-verified

1646
1647// IsLocalVariable reports whether the variable name is locally bound by the folder scope.
1648func (f *folder) IsLocalVariable(name string) bool {
1649 if name == f.accuVar {
1650 return true
1651 }
1652 if !f.computeResult && (name == f.iterVar || name == f.iterVar2) {
1653 return true
1654 }
1655 parent := f.Parent()
1656 if parent == nil {
1657 return false
1658 }
1659 if varHolder, ok := parent.(localVariableHolder); ok {
1660 if varHolder.IsLocalVariable(name) {
1661 return true
1662 }
1663 }
1664 return false
1665}
1666
1667// UnknownAttributePatterns implements the PartialActivation interface returning the unknown patterns
1668// if they were provided to the input activation, or an empty set if the proxied activation is not partial.

Callers

nothing calls this directly

Calls 2

ParentMethod · 0.95
IsLocalVariableMethod · 0.65

Tested by

no test coverage detected