For the last question:
> parse (many digit) "123abc" [("123", "abc")]
Means the parsing was successful because at least one result was returned in the answer list. Hutton guerrillas always return a list - an empty list means parsing.
The result (โ123โ, โabcโ) means that the parsing detected three digits โ123โ and stopped at โaโ, which is not a digit, so โthe rest of the inputโ is โabcโ.
Note that many means "as much as possible" not "one or more." If it were "one or more", you would get this result:
[("1", "23abc"), ("12", "3abc"), ("123", "abc")]
This behavior is not well suited for deterministic parsing, although sometimes it may be required for natural language parsing.
source share