%destructor { close_scope(state); table_free($$); } table_block_alloc
%type <chain> chain_block_alloc chain_block
%destructor { close_scope(state); chain_free($$); } chain_block_alloc
-%type <rule> rule
+%type <rule> rule rule_alloc
%destructor { rule_free($$); } rule
%type <val> set_flag_list set_flag
}
;
-comment_spec : /* empty */
- {
- $$ = NULL;
- }
- | COMMENT string
+comment_spec : COMMENT string
{
$$ = $2;
}
}
;
-rule : stmt_list comment_spec
+rule : rule_alloc
+ {
+ $$->comment = NULL;
+ }
+ | rule_alloc comment_spec
+ {
+ $$->comment = $2;
+ }
+ ;
+
+rule_alloc : stmt_list
{
struct stmt *i;
$$ = rule_alloc(&@$, NULL);
- $$->comment = $2;
list_for_each_entry(i, $1, list)
$$->num_stmts++;
list_splice_tail($1, &$$->stmts);
{
$<expr>0->timeout = $2 * 1000;
}
- | COMMENT string
+ | comment_spec
{
- $<expr>0->comment = $2;
+ $<expr>0->comment = $1;
}
;