I use something like

token idf { $<body>=[ \w+ ] <!{$<body> ~~ :i/^ where $/}> }

but there are likely to be simpler solutions.

yary schreef op 2017-03-09 16:12:
The method for defining reserved words in general is to have a rule
that matches them (typically "match anything in this array" or a long
alternation), and then modifying the rules where those reserved words
are not allowed to reject them.

So for that grammar, you want to change "identifier" to reject

The exact method of doing so, I don't know!

Theo van den Heuvel
Van den Heuvel HLT Consultancy

Reply via email to