L.s.,

I found a small problem when writing a piece of grammar. A simplified part of it is shown here;
...
token tag-body   { <body-start> ~ <body-end> <body-text> }
token body-start { '[' }
token body-end  { ']' }
token body-text  { .*? <?body-end> }
...

I needed to do something on body-end so I wrote a method for it using an actions class and it works of course but in this situation the method is called twice. One time to say there is a 'body-end' coming and one time to say it is gobbled up. Because I couldn't see in the method which situation it was called for I had to rewrite it like below
...
token tag-body   { <body-start> ~ <body-end> <body-text> }
token body-start { '[' }
token body-end   { ']' }
token body-text  { .*? <?body-end2> }
token body-end2 { ']' }
...
which is less elegant. The question is more or less directed to a perl6 implementer;

 * Is there a possibility to give the method more information in the
   form of boolean flags saying for example that there was a look ahead
   match, all in all the parser knows about the way it must seek!

Thanks in advance,
Marcel Timmerman

Reply via email to