Fix parser failing on comments inside ternary expressions

This commit is contained in:
Senthilnathan
2026-07-07 14:18:42 +05:30
parent 1d0d31cf4c
commit d7fc7c653c
3 changed files with 44 additions and 0 deletions

View File

@@ -1529,6 +1529,9 @@ gb_internal Token advance_token(AstFile *f) {
switch (f->curr_token.kind) {
case Token_Comment:
consume_comment_groups(f, prev);
if (f->curr_token.kind == Token_Semicolon && ignore_newlines(f) && f->curr_token.string == "\n") {
advance_token(f);
}
break;
case Token_Semicolon:
if (ignore_newlines(f) && f->curr_token.string == "\n") {