parser: minor refactoring

* src/parse-gram.y (symbol.prec): Reuse int.opt.
This commit is contained in:
Akim Demaille
2018-12-09 08:46:59 +01:00
parent 157f12c483
commit 17730b0287

View File

@@ -458,16 +458,12 @@ symbols.prec:
; ;
symbol.prec: symbol.prec:
symbol symbol[id] int.opt[num]
{ {
$$ = $1; $$ = $id;
symbol_class_set ($1, token_sym, @1, false); symbol_class_set ($id, token_sym, @id, false);
} if (0 <= $num)
| symbol INT symbol_user_token_number_set ($id, $num, @num);
{
$$ = $1;
symbol_class_set ($1, token_sym, @1, false);
symbol_user_token_number_set ($1, $2, @2);
} }
; ;