Don't ask to ask, just ask | |
PerlMonks |
Re: P6: parsing whitespaceby moritz (Cardinal) |
on Jun 09, 2010 at 18:01 UTC ( [id://843880]=note: print w/replies, xml ) | Need Help?? |
If you have whitespace in a rule, it is internally replaced by a call to the ws token.
The default ws matches at least one space (\s+) if the left and right are word characters (ie matching \w), and matching zero or more (\s*) otherwise. In code:
Where ww is within word, and could be defined as
If you want 8.8x5.0 to match, you need to override the ws rule in your grammar:
(Update: fixed ww rule after comment from TimToady++)
Perl 6 - links to (nearly) everything that is Perl 6.
In Section
Seekers of Perl Wisdom
|
|