mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 07:08:48 +00:00
Fix ast.Branch_Node parsing in package odin/parser
This commit is contained in:
@@ -1101,12 +1101,14 @@ parse_stmt :: proc(p: ^Parser) -> ^ast.Stmt {
|
|||||||
|
|
||||||
case .Break, .Continue, .Fallthrough:
|
case .Break, .Continue, .Fallthrough:
|
||||||
tok := advance_token(p);
|
tok := advance_token(p);
|
||||||
label: ^ast.Expr;
|
label: ^ast.Ident;
|
||||||
if tok.kind != .Fallthrough && p.curr_tok.kind == .Ident {
|
if tok.kind != .Fallthrough && p.curr_tok.kind == .Ident {
|
||||||
label = parse_ident(p);
|
label = parse_ident(p);
|
||||||
}
|
}
|
||||||
end := label.end if label != nil else end_pos(tok);
|
end := label.end if label != nil else end_pos(tok);
|
||||||
s := ast.new(ast.Branch_Stmt, tok.pos, end);
|
s := ast.new(ast.Branch_Stmt, tok.pos, end);
|
||||||
|
s.tok = tok;
|
||||||
|
s.label = label;
|
||||||
expect_semicolon(p, s);
|
expect_semicolon(p, s);
|
||||||
return s;
|
return s;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user