Fix: Unterminated function's body statements #76
Annotations
2 errors
tests/parser.test.ts > Parser > should parse function declaration with parameters and block statement:
tests/parser.test.ts#L70
AssertionError: expected { kind: 'Program', body: [ { …(4) } ] } to deeply equal { kind: 'Program', body: [ { …(4) } ] }
- Expected
+ Received
Object {
"body": Array [
Object {
"body": Array [
Object {
"kind": "ReturnExpr",
"value": Object {
"kind": "BinaryExpr",
"left": Object {
"kind": "Identifier",
"symbol": "a",
},
"operator": "+",
"right": Object {
"kind": "Identifier",
"symbol": "b",
},
},
},
+ Object {
+ "kind": "FunctionTerminator",
+ },
],
"kind": "FunctionDeclaration",
"name": "add",
"parameters": Array [
"a",
"b",
],
},
],
"kind": "Program",
}
❯ tests/parser.test.ts:70:17
|
test
Process completed with exit code 1.
|