Re: How to defined reversed word in a perl6 grammar ?

2017-03-09 Thread Theo van den Heuvel
however in such a simple case we could just write token idf { $=[ \w+ ] .uc eq 'WHERE' }> } cheers, Theo van den Heuvel schreef op 2017-03-09 19:42: I use something like token idf { $=[ \w+ ] ~~ :i/^ where $/}> } but there are likely to be simpler solutions. yary schreef op 2017-03-09

Re: How to defined reversed word in a perl6 grammar ?

2017-03-09 Thread Theo van den Heuvel
I use something like token idf { $=[ \w+ ] ~~ :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

Re: How to defined reversed word in a perl6 grammar ?

2017-03-09 Thread Timo Paulssen
Hi, Wouldn't it be enough to use something that backtracks? As you might know, "token" is "regex + ratcheting" and "rule" is "token + sigspace". HTH - Timo