Skip to content

Commit

Permalink
Parser: fix parsing empty lists
Browse files Browse the repository at this point in the history
  • Loading branch information
mrunix00 committed Aug 3, 2024
1 parent be2e6a4 commit a2266c5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ ArrayAccess:
}

List:
LBracket Elements RBracket {
LBracket RBracket {
$$ = new List({});
}
| LBracket Elements RBracket {
$$ = new List(*static_cast<std::vector<AbstractSyntaxTree*>*>($2));
}
;
Expand Down

0 comments on commit a2266c5

Please sign in to comment.