Skip to content

Commit

Permalink
fix(while): Fixed while unknown node and working properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
natangscalvence committed Jan 17, 2025
1 parent 72f379a commit c00be2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/frontend/parser/statements/parse_while_stmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "frontend/parser/core.h"
#include "utils.h"


AstNode *parse_while_stmt(Parser *parser) {
int line = current_token(parser).line;
int column_start = current_token(parser).column_start;
Expand All @@ -26,6 +25,7 @@ AstNode *parse_while_stmt(Parser *parser) {
WhileNode *while_data = MALLOC_S(sizeof(WhileNode));
while_data->body = NULL;
while_data->body_count = 0;
while_data->condition = condition;

while (not_eof(parser) && current_token(parser).type != TOKEN_END) {
while_data->body = REALLOC_S(
Expand Down

0 comments on commit c00be2b

Please sign in to comment.