|| at Apr 15, 2015 at 11:50 am
No, an action code block is always called when a match succeeded, and
cannot turn that into a match fail. Returning an error doesn't change that,
it just adds the error to the list of errors encountered (that can be
useful to return a specific error when you know for sure that backtracking
cannot match anything else - that's what pigeon does in its grammar for
unclosed literals, for example).
For & and !, the boolean decides whether it is a match or not (& is a match
if it returns true, ! is a match if it returns false). This is like the
non-code block version of & and ! operators.
On Wednesday, 15 April 2015 07:31:37 UTC-4, Peter Kleiweg wrote:
What happens when an expression return an error? Does that make the match
fail, and the parser backtrack?
With 'and' and 'not' expressions, what is the meaning of boolean return
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
For more options, visit https://groups.google.com/d/optout.