(l *Lexer)
| 127 | } |
| 128 | |
| 129 | func identifier(l *Lexer) stateFn { |
| 130 | loop: |
| 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 | |
| 157 | func not(l *Lexer) stateFn { |
| 158 | l.emit(Operator) |
nothing calls this directly
no test coverage detected
searching dependent graphs…