Closed stchang closed 10 years ago
I was going to change parse
to essentially be what you wrote, but you make a good point regarding debugging, so I'm onboard with leaving as is and adding parse-result
.
If it's convenient, can you just push the change? Otherwise I'll get to it maybe tonight or this weekend.
This did seem weird to me at first; in my app I ended up defining a
parse-result
function. However, the status quoparse
very useful when debugging parsers. Especially getting the returned newState
: Did my parser proceed too far? You can't always tell that from the result, because a parser doesn't always return everything it consumes.So I suggest keeping
parse
as-is, but adding aparse-result
function. How I did it:If this looks OK (?) let me know whether you want me to make the change or you will?