Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow
%prec
to define a token in the grammar.
Previously if `%prec 'x'` was the first mention of the token `x` then cfgrammar would say "'x' isn't a token" which is clearly incorrect. This commit is maybe best thought of as a quick fix of sorts: it makes `%prec 'x'` define a token `x` if it doesn't already exist. However -- and my memory is completely fuzzy as to whether this is a Yacc compatibility thing or not -- this means that `%prec 'x'` and `%prec x' (i.e. with and without quote marks) have the semantic meaning because `parse_token` treats both interchangeably. This seems consistent with other parts of the grammar even if a little odd.
- Loading branch information