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

Function not

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

Source from the content-addressed store, hash-verified

155}
156
157func not(l *Lexer) stateFn {
158 l.emit(Operator)
159
160 l.skipSpaces()
161
162 end := l.end
163
164 // Get the next word.
165 for {
166 r := l.next()
167 if utils.IsAlphaNumeric(r) {
168 // absorb
169 } else {
170 l.backup()
171 break
172 }
173 }
174
175 switch l.word() {
176 case "in", "matches", "contains", "startsWith", "endsWith":
177 l.emit(Operator)
178 default:
179 l.end = end
180 }
181 return root
182}
183
184func questionMark(l *Lexer) stateFn {
185 l.accept(".?")

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected