diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-06-18 21:45:15 -0400 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-06-22 09:42:33 -0400 |
| commit | fc58158fb76ea76c59454b3d201dfac182a61e73 (patch) | |
| tree | 87e87cccb9f5cb501e13b7a7f4d3b34097176064 /core | |
| parent | 757c243aaf73e8bc75dbe592817d56794f0ee5ca (diff) | |
Fix issue parsing `vendor/stb/image` with the `core:odin/parser` parser
Diffstat (limited to 'core')
| -rw-r--r-- | core/odin/parser/parser.odin | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/core/odin/parser/parser.odin b/core/odin/parser/parser.odin index 7f1f4ca87..762410415 100644 --- a/core/odin/parser/parser.odin +++ b/core/odin/parser/parser.odin @@ -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)) |