diff --git a/TODO.md b/TODO.md index e64b2c6..5c20b3d 100644 --- a/TODO.md +++ b/TODO.md @@ -1,7 +1,7 @@ -0. Create file to describe properties of terminology used; param, arg, var, &c. -1. Differenciate parameters and arguments -- params for function definitions, +1. Differentiate parameters and arguments -- params for function definitions, arguments for function calls -2. Add scope field to all ASTs, and new scope layer for those that need it. Change editor to GNU Readline. Make variables persist through lines in the editor. + +Return syntax errors as exceptions. diff --git a/src/grammar.y b/src/grammar.y index 1019d5a..c5375c5 100644 --- a/src/grammar.y +++ b/src/grammar.y @@ -125,11 +125,11 @@ exp: NUM { $$ = ast_init(AST_TYPE_NUM, ast_num_data_init($1)); } // Function definitions. - | WORD GROUPS arg GROUPE EQ exp { + | WORD GROUPS arg GROUPE exp { size_t argc = $3->ln; AST** argv = $3->buf; argarr_destroypsv($3); - $$ = ast_init(AST_TYPE_FDEF, ast_fdef_data_init($1, argc, argv, $6)); + $$ = ast_init(AST_TYPE_FDEF, ast_fdef_data_init($1, argc, argv, $5)); } | BLOCKS block BLOCKE {