Open yetanotherion opened 6 years ago
Interesting! Definitely a bug. It's been a while, but I thought that whitespace handling was optional by definition. I'll look into it.
Why not simply replacing
implicit val W = Whitespace("""\s+"""r)
with
implicit val W = Whitespace("""\s*"""r)
? (...+...
=> ...*...
)
Executing the Direct Grammar on a worksheet
among others, one input of the README
does not parse and generates
instead. The expression producing the expected output requires whitespaces at the beginning and the end.
(I suspect this may be due to
Note that parseback's whitespace handling is currently extremely naive. The only whitespace regular expressions which will behave appropriately are of the form .+, where . is "any single character class". Thus, \s+ is valid, as is [ \t]+, but //[^\n]*|\s+ is not. We hope to lift this restriction soon, but it requires some work on the algorithm.
isn't it?)