Commit cb7da2cc cb7da2ccc3137cdeeae0152f69a59c22adca7e72 by Sergey Poznyakoff

Fixed precedences of ',' and '+'

1 parent 26c37440
...@@ -109,6 +109,9 @@ static list_t rule_list; ...@@ -109,6 +109,9 @@ static list_t rule_list;
109 %token <string> STRING 109 %token <string> STRING
110 %token EOL BOGUS 110 %token EOL BOGUS
111 111
112 %left ','
113 %left '+'
114
112 %type <string> string arg type 115 %type <string> string arg type
113 %type <list> arglist 116 %type <list> arglist
114 %type <node> function stmt rule 117 %type <node> function stmt rule
...@@ -159,15 +162,15 @@ type : IDENT '/' IDENT ...@@ -159,15 +162,15 @@ type : IDENT '/' IDENT
159 ; 162 ;
160 163
161 rule : stmt 164 rule : stmt
162 | rule stmt 165 | rule rule %prec ','
163 { 166 {
164 $$ = make_binary_node (L_OR, $1, $2); 167 $$ = make_binary_node (L_OR, $1, $2);
165 } 168 }
166 | rule ',' stmt 169 | rule ',' rule
167 { 170 {
168 $$ = make_binary_node (L_OR, $1, $3); 171 $$ = make_binary_node (L_OR, $1, $3);
169 } 172 }
170 | rule '+' stmt 173 | rule '+' rule
171 { 174 {
172 $$ = make_binary_node (L_AND, $1, $3); 175 $$ = make_binary_node (L_AND, $1, $3);
173 } 176 }
......