MCPcopy
hub / github.com/google/mangle / variablesForArgMode

Function variablesForArgMode

analysis/validation.go:490–504  ·  view source on GitHub ↗

variablesForArgMode returns variable arguments that match an argmode mask.

(atom ast.Atom, mode ast.Mode, mask ast.ArgMode)

Source from the content-addressed store, hash-verified

488
489// variablesForArgMode returns variable arguments that match an argmode mask.
490func variablesForArgMode(atom ast.Atom, mode ast.Mode, mask ast.ArgMode) []ast.Variable {
491 var boundVars []ast.Variable
492
493 for i, argMode := range mode {
494 if argMode&mask == 0 {
495 continue
496 }
497
498 if v, ok := atom.Args[i].(ast.Variable); ok {
499 boundVars = append(boundVars, v)
500 }
501 }
502
503 return boundVars
504}
505
506// CheckRule checks arity and that every variable appearing is bound.
507// A variable is bound when:

Callers 2

RewriteClauseFunction · 0.85
CheckRuleMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected