Proper pretty printing and error handling on non-cool if condition.
This commit is contained in:
@@ -794,6 +794,7 @@ statement :: (parse_state : *Parse_State) -> *AST_Node {
|
||||
if_expression := expression(parse_state);
|
||||
add_child(node, if_expression);
|
||||
// consume(parse_state, .TOKEN_LEFTBRACE, "Expect '{' after if-condition.");
|
||||
source_location.end = parse_state.previous;
|
||||
|
||||
if_body := block(parse_state);
|
||||
if if_body.children.count > 0 {
|
||||
@@ -804,8 +805,7 @@ statement :: (parse_state : *Parse_State) -> *AST_Node {
|
||||
else_node := else_statement(parse_state);
|
||||
add_child(node, else_node);
|
||||
}
|
||||
|
||||
source_location.end = parse_state.previous;
|
||||
|
||||
node.source_location = source_location;
|
||||
|
||||
return node;
|
||||
|
||||
Reference in New Issue
Block a user