summaryrefslogtreecommitdiffhomepage
path: root/main.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2024-12-06 09:13:31 +0100
committerJo-Philipp Wich <jo@mein.io>2024-12-06 09:46:38 +0100
commit9bcd25f54708c2d6bde79f266f1b74d432f4571f (patch)
tree9125c0c0ddd9b58907ed6bfdfe296883450cd593 /main.c
parentc71444ea301f0968476ea5bf1b8912b0b65308d7 (diff)
lexer: Preserve keyword, regexp flags until processing non-comment tokens
When the lexer has either the `no_keyword` or `no_regexp` flag set, it should retain these flags until it encounters a non-comment token. Only then should it stop preventing the interpretation of tokens beginning with a letter or forward slash as keywords or regular expression literals, respectively. Previously, these flags were being reset too early when processing comments, which could cause incorrect parsing when comments appeared between relevant tokens. The flags should only be reset after consuming an actual non-comment token to ensure consistent parsing behavior. Fixes: #250 Fixes: 855854f ("lexer: emit comment and template statement block tokens") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'main.c')
0 files changed, 0 insertions, 0 deletions