| 434 | } |
| 435 | |
| 436 | static bool scan_word(TSLexer *lexer, const char* const word) { |
| 437 | for (uint8_t i = 0; word[i] != '\0'; i++) { |
| 438 | if (lexer->lookahead != word[i]) { |
| 439 | return false; |
| 440 | } |
| 441 | advance(lexer); |
| 442 | } |
| 443 | // `match_` must not match the keyword `match`. |
| 444 | return !(is_alnum(lexer->lookahead) || lexer->lookahead == '_' || |
| 445 | lexer->lookahead == '$'); |
| 446 | } |
| 447 | |
| 448 | // Reads one identifier-like word into `buf`. Returns -1 when the word |
| 449 | // cannot be an ASCII keyword. The whole word is always consumed, so a |
no test coverage detected