%type <string> value;
%type <string> words;
+%precedence WORD
+
%left APPEND
%left ASSIGN
| thing
;
-thing : assignment_or_empty
+thing : assignment
| block
+ | empty
;
empty : whitespace NEWLINE
| /* empty */
;
-variable : whitespace WORD whitespace
+variable : WORD whitespace
{
- $$ = $2;
+ $$ = $1;
};
value : whitespace words whitespace
current_block = NULL;
}
-block : block_opening assignments block_closing;
+block : block_opening block_assignments block_closing;
-assignments : assignments assignment_or_empty
- | assignment_or_empty
- ;
+block_assignments : block_assignments block_assignment
+ | block_assignment;
-assignment_or_empty : assignment
+block_assignment : WHITESPACE assignment
| empty;
assignment : variable ASSIGN value NEWLINE
ABORT;
}
-define : whitespace DEFINE WHITESPACE variable NEWLINE
+define : DEFINE WHITESPACE variable NEWLINE
{
- $$ = $4;
+ $$ = $3;
}
| whitespace variable NEWLINE
{