Updated syntax to abbreviate functions defs.
This commit is contained in:
parent
3b5bee0695
commit
67aafb3ead
6
TODO.md
6
TODO.md
@ -1,7 +1,7 @@
|
|||||||
0. Create file to describe properties of terminology used; param, arg, var, &c.
|
1. Differentiate parameters and arguments -- params for function definitions,
|
||||||
1. Differenciate parameters and arguments -- params for function definitions,
|
|
||||||
arguments for function calls
|
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.
|
Change editor to GNU Readline.
|
||||||
Make variables persist through lines in the editor.
|
Make variables persist through lines in the editor.
|
||||||
|
|
||||||
|
Return syntax errors as exceptions.
|
||||||
|
@ -125,11 +125,11 @@ exp:
|
|||||||
NUM { $$ = ast_init(AST_TYPE_NUM, ast_num_data_init($1)); }
|
NUM { $$ = ast_init(AST_TYPE_NUM, ast_num_data_init($1)); }
|
||||||
|
|
||||||
// Function definitions.
|
// Function definitions.
|
||||||
| WORD GROUPS arg GROUPE EQ exp {
|
| WORD GROUPS arg GROUPE exp {
|
||||||
size_t argc = $3->ln;
|
size_t argc = $3->ln;
|
||||||
AST** argv = $3->buf;
|
AST** argv = $3->buf;
|
||||||
argarr_destroypsv($3);
|
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 {
|
| BLOCKS block BLOCKE {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user