MCPcopy Index your code
hub / github.com/expr-lang/expr / identifier

Function identifier

parser/lexer/state.go:129–155  ·  view source on GitHub ↗
(l *Lexer)

Source from the content-addressed store, hash-verified

127}
128
129func identifier(l *Lexer) stateFn {
130loop:
131 for {
132 switch r := l.next(); {
133 case utils.IsAlphaNumeric(r):
134 // absorb
135 default:
136 l.backup()
137 switch l.word() {
138 case "not":
139 return not
140 case "in", "or", "and", "matches", "contains", "startsWith", "endsWith", "let":
141 l.emit(Operator)
142 case "if", "else":
143 if !l.DisableIfOperator {
144 l.emit(Operator)
145 } else {
146 l.emit(Identifier)
147 }
148 default:
149 l.emit(Identifier)
150 }
151 break loop
152 }
153 }
154 return root
155}
156
157func not(l *Lexer) stateFn {
158 l.emit(Operator)

Callers

nothing calls this directly

Calls 5

IsAlphaNumericFunction · 0.92
backupMethod · 0.80
wordMethod · 0.80
nextMethod · 0.45
emitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…