|
For reasons I cannot fully explain, adding the semantic predicates to the atom rule caused the prediction checks in the generated parser to be very different. As far as I can tell our use of k=3 in the grammar also comes into play as the predictions were checking 3 tokens out. The end result being that after COLON the parser was always looking specifically for IDENT (not allowing for keyword-turned-ident). Moving the semantic predicates (and therefore recognition of CAST/FUNCTION) to primaryExpression instead fixed the problem.
This part of the grammar (atom/primaryExpression and related sub-rules) is a mess imo. It tries to generically handle too many cases. However refactoring them to be more readable would require major changes and is best left for the new parser
|