Aaron Sherman wrote: > One of the first things that's becoming obvious to me in playing with > Rakudo's rules is that parsing strings isn't always what I'm going to > want to do. The most common example of wanting to parse data that's > not in string form is the YACC scenario where you want to have a > function produce a stream of tokenized data that is then parsed into a > more complex representation. In similar fashion there's transformers > like TGE that take syntax trees and transform them into alternative > representations. > > To that end, I'd like to suggest (for 6.1 or whatever comes after > initial stability) an extension to rules:
Did you read http://perlcabal.org/syn/S05.html#Matching_against_non-strings already? It's not yet implemented by any compiler, but seems to (mostly) do what you want already, no? Cheers, Moritz