Closed thomp closed 13 years ago
The actual problem was in breadth? parser, which didn't emit an empty match even when argument MIN was nil/0, which means that FIND? only matched when there was at least one other token before the match. I fixed that (by removing a condition actually, not sure what I was thinking) and added a test case.
FIND? doesn't technically always find the first match, since backtracking might force a match to another one. FIND* actually forces the first match. I clarified the docstrings.
Looks good to me.
Thanks for making your parser combinator code available. Fun stuff. I noted that FIND?, while advertised as looking for the first match, does not seem to leave the context at the corresponding point (i.e., directly succeeding the first match):
Given the advertised behavior of FIND?, would it be preferable to leave the context at the point directly after the first match?
where FIND?2 is something like
Thanks again,
Alan