Skip to content

Commit

Permalink
fix: parsing return statement for functions
Browse files Browse the repository at this point in the history
  • Loading branch information
pacifiquem committed Feb 7, 2024
1 parent 478f5fe commit 194ad28
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions tests/parser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,19 @@ describe('Parser', () => {
kind: 'FunctionDeclaration',
name: 'add',
parameters: ['a', 'b'],
body: [
{
kind: 'ReturnExpr',
value: {
kind: 'BinaryExpr',
operator: '+',
left: { kind: 'Identifier', symbol: 'a' },
right: { kind: 'Identifier', symbol: 'b' },
},
body: [],
return: {
kind: 'BinaryExpr',
operator: '+',
left: {
kind: 'Identifier',
symbol: 'a',
},
],
right: {
kind: 'Identifier',
symbol: 'b',
},
},
},
],
};
Expand Down

0 comments on commit 194ad28

Please sign in to comment.