Fix issue parsing vendor/stb/image with the core:odin/parser parser

This commit is contained in:
Brad Lewis
2025-06-18 21:45:15 -04:00
parent 757c243aaf
commit fc58158fb7
2 changed files with 30 additions and 4 deletions
+2 -4
View File
@@ -2307,6 +2307,7 @@ parse_operand :: proc(p: ^Parser, lhs: bool) -> ^ast.Expr {
open := expect_token(p, .Open_Paren)
p.expr_level += 1
expr := parse_expr(p, false)
skip_possible_newline(p)
p.expr_level -= 1
close := expect_token(p, .Close_Paren)
@@ -3526,6 +3527,7 @@ parse_binary_expr :: proc(p: ^Parser, lhs: bool, prec_in: int) -> ^ast.Expr {
case .When:
x := expr
cond := parse_expr(p, lhs)
skip_possible_newline(p)
else_tok := expect_token(p, .Else)
y := parse_expr(p, lhs)
te := ast.new(ast.Ternary_When_Expr, expr.pos, end_pos(p.prev_tok))
@@ -3780,10 +3782,6 @@ parse_import_decl :: proc(p: ^Parser, kind := Import_Decl_Kind.Standard) -> ^ast
import_name.pos = p.curr_tok.pos
}
if !is_using && is_blank_ident(import_name) {
error(p, import_name.pos, "illegal import name: '_'")
}
path := expect_token_after(p, .String, "import")
decl := ast.new(ast.Import_Decl, tok.pos, end_pos(path))