in reply to P6: parsing whitespace
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:
class Grammar { token ws { <!ww> \s* } }
Where ww is within word, and could be defined as
token ww { <after \w> <before \w> }
If you want 8.8x5.0 to match, you need to override the ws rule in your grammar:
grammar Calc { token ws { \s* } # rest of your code here without any modifications
(Update: fixed ww rule after comment from TimToady++)
|
|---|