operator processes the Operator token at the current position. The lexer *must* know the next token is a Operator before calling.
()
| 307 | // operator processes the Operator token at the current position. |
| 308 | // The lexer *must* know the next token is a Operator before calling. |
| 309 | func (l *lexer) operator() { |
| 310 | tok := &Token{Type: Operator, Range: Range{Start: l.pos, End: l.pos}} |
| 311 | for l.e == nil { |
| 312 | switch l.next() { |
| 313 | case '=', '|': |
| 314 | tok.Range.End = l.pos |
| 315 | l.toks = append(l.toks, tok) |
| 316 | return |
| 317 | } |
| 318 | } |
| 319 | } |
| 320 | |
| 321 | // lineComment processes the Comment token at the current position. |
| 322 | // The lexer *must* know the next token is a Comment before calling. |