| 62 | // Scanner functions |
| 63 | |
| 64 | static bool scan_string_start(TSLexer *lexer, Stack *stack) { |
| 65 | if (lexer->lookahead != '"') return false; |
| 66 | advance(lexer); |
| 67 | lexer->mark_end(lexer); |
| 68 | for (unsigned count = 1; count < DELIMITER_LENGTH; ++count) { |
| 69 | if (lexer->lookahead != '"') { |
| 70 | // It's not a triple quoted delimiter. |
| 71 | stack_push(stack, '"', false); |
| 72 | return true; |
| 73 | } |
| 74 | advance(lexer); |
| 75 | } |
| 76 | lexer->mark_end(lexer); |
| 77 | stack_push(stack, '"', true); |
| 78 | return true; |
| 79 | } |
| 80 | |
| 81 | static bool scan_string_content(TSLexer *lexer, Stack *stack) { |
| 82 | if (stack->size == 0) return false; // Stack is empty. We're not in a string. |
no test coverage detected