| ... | @@ -76,11 +76,13 @@ static AstNode *ast_create_node_no_line_info(ParseContext *pc, NodeType type) { | ... | @@ -76,11 +76,13 @@ static AstNode *ast_create_node_no_line_info(ParseContext *pc, NodeType type) { |
| 76 | } | 76 | } |
| 77 | | 77 | |
| 78 | static void ast_update_node_line_info(AstNode *node, Token *first_token) { | 78 | static void ast_update_node_line_info(AstNode *node, Token *first_token) { |
| | 79 | assert(first_token); |
| 79 | node->line = first_token->start_line; | 80 | node->line = first_token->start_line; |
| 80 | node->column = first_token->start_column; | 81 | node->column = first_token->start_column; |
| 81 | } | 82 | } |
| 82 | | 83 | |
| 83 | static AstNode *ast_create_node(ParseContext *pc, NodeType type, Token *first_token) { | 84 | static AstNode *ast_create_node(ParseContext *pc, NodeType type, Token *first_token) { |
| | 85 | assert(first_token); |
| 84 | AstNode *node = ast_create_node_no_line_info(pc, type); | 86 | AstNode *node = ast_create_node_no_line_info(pc, type); |
| 85 | ast_update_node_line_info(node, first_token); | 87 | ast_update_node_line_info(node, first_token); |
| 86 | return node; | 88 | return node; |
| ... | @@ -1541,6 +1543,7 @@ static AstNode *ast_parse_while_expr(ParseContext *pc, size_t *token_index, bool | ... | @@ -1541,6 +1543,7 @@ static AstNode *ast_parse_while_expr(ParseContext *pc, size_t *token_index, bool |
| 1541 | return nullptr; | 1543 | return nullptr; |
| 1542 | } | 1544 | } |
| 1543 | } else if (first_token->id == TokenIdKeywordWhile) { | 1545 | } else if (first_token->id == TokenIdKeywordWhile) { |
| | 1546 | while_token = first_token; |
| 1544 | is_inline = false; | 1547 | is_inline = false; |
| 1545 | *token_index += 1; | 1548 | *token_index += 1; |
| 1546 | } else if (mandatory) { | 1549 | } else if (mandatory) { |