aboutsummaryrefslogtreecommitdiff
path: root/src/bind-gram.y
diff options
context:
space:
mode:
Diffstat (limited to 'src/bind-gram.y')
-rw-r--r--src/bind-gram.y17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/bind-gram.y b/src/bind-gram.y
index 5acc780..7259e5d 100644
--- a/src/bind-gram.y
+++ b/src/bind-gram.y
@@ -55,17 +55,28 @@ static struct grecs_value *stmtlist_to_value(struct grecs_node *node);
%type <svalue> value ctlsub
%type <pvalue> vallist tag
%type <list> vlist ctllist
-%type <node> stmt simple block
+%type <node> stmt simple block maybe_stmtlist
%type <node_list> stmtlist
%%
-input : stmtlist
+input : maybe_stmtlist
{
parse_tree = grecs_node_create(grecs_node_root,
&grecs_current_locus);
parse_tree->v.texttab = grecs_text_table();
- grecs_node_bind(parse_tree, $1.head, 1);
+ grecs_node_bind(parse_tree, $1, 1);
+ }
+ ;
+
+maybe_stmtlist:
+ /* empty */
+ {
+ $$ = NULL;
+ }
+ | stmtlist
+ {
+ $$ = $1.head;
}
;

Return to:

Send suggestions and report system problems to the System administrator.