From 97d7d8301a26bfbc4cb084ee9836224f654ae0e0 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Wed, 16 Sep 2020 22:19:57 +0100 Subject: [PATCH] Fix ast.Branch_Node parsing in package odin/parser --- core/odin/parser/parser.odin | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/odin/parser/parser.odin b/core/odin/parser/parser.odin index d58a02841..c7489b67a 100644 --- a/core/odin/parser/parser.odin +++ b/core/odin/parser/parser.odin @@ -1101,12 +1101,14 @@ parse_stmt :: proc(p: ^Parser) -> ^ast.Stmt { case .Break, .Continue, .Fallthrough: tok := advance_token(p); - label: ^ast.Expr; + label: ^ast.Ident; if tok.kind != .Fallthrough && p.curr_tok.kind == .Ident { label = parse_ident(p); } end := label.end if label != nil else end_pos(tok); s := ast.new(ast.Branch_Stmt, tok.pos, end); + s.tok = tok; + s.label = label; expect_semicolon(p, s); return s;