Skip to content

Commit

Permalink
Containers: Expect open block at the right place
Browse files Browse the repository at this point in the history
  • Loading branch information
N00byEdge committed Oct 8, 2023
1 parent 0ef8557 commit 34a99fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion selfhost/parser.n
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ fn parse_primary_expression(context: *ParserContext, require: bool, precedence:
}
else if(p == .struct_keyword || p == .union_keyword || p == .enum_keyword) {
const token = context.advance();
context.expect("Expected '{' before container body".&, .@"{");
var is_enum = false;
// TODO: Make == a proper value so that we don't have to do this shit
if(p == .enum_keyword) {
Expand All @@ -300,6 +299,7 @@ fn parse_primary_expression(context: *ParserContext, require: bool, precedence:
}
}
const retval = add_with_token(token, .container_expression);
context.expect("Expected '{' before container body".&, .@"{");
node_payload.get(retval).* = parse_container_body(context, is_enum);
context.expect("Expected '}' before container body".&, .@"}");
return retval;
Expand Down

0 comments on commit 34a99fb

Please sign in to comment.