- DeclareFunction -> func FuncName ( OpenScope Args ) Block Newlines ${ {
- struct text funcname = { " func", 5};
- $0 = $<FN;
- if ($0) {
- struct value fn = {.function = $<Bl};
- $0->type = add_type(c, funcname, &function_prototype);
- $0->type->function.params = reorder_bilist($<Ar);
- global_alloc(c, $0->type, $0, &fn);
- var_block_close(c, CloseSequential, fn.function);
- } else
- var_block_close(c, CloseSequential, NULL);
- } }$
- | func FuncName IN OpenScope OptNL Args OUT OptNL do Block Newlines ${ {
- struct text funcname = { " func", 5};
- $0 = $<FN;
- if ($0) {
- struct value fn = {.function = $<Bl};
- $0->type = add_type(c, funcname, &function_prototype);
- $0->type->function.params = reorder_bilist($<Ar);
- global_alloc(c, $0->type, $0, &fn);
- var_block_close(c, CloseSequential, fn.function);
- } else
- var_block_close(c, CloseSequential, NULL);
- } }$
- | func FuncName NEWLINE OpenScope OptNL do Block Newlines ${ {
- struct text funcname = { " func", 5};
- $0 = $<FN;
- if ($0) {
- struct value fn = {.function = $<Bl};
- $0->type = add_type(c, funcname, &function_prototype);
- $0->type->function.params = NULL;
- global_alloc(c, $0->type, $0, &fn);
- var_block_close(c, CloseSequential, fn.function);
- } else
- var_block_close(c, CloseSequential, NULL);
- } }$
+ DeclareFunction -> func FuncName ( OpenScope Args ) Block Newlines ${
+ $0 = declare_function(c, $<FN, $<Ar, $<Bl);
+ }$
+ | func FuncName IN OpenScope OptNL Args OUT OptNL do Block Newlines ${
+ $0 = declare_function(c, $<FN, $<Ar, $<Bl);
+ }$
+ | func FuncName NEWLINE OpenScope OptNL do Block Newlines ${
+ $0 = declare_function(c, $<FN, NULL, $<Bl);
+ }$