Closed adMartem closed 4 months ago
If a single !
is used there is no recovery action side-effect except that the parse exception, if any, associated with the recovery is captured and can be retrieved later by a visitor. If either !!
or !->
is used it must be followed immediately by a code block that is performed when the recovery method has returned to the production method. At that point CURRENT_NODE and THIS_PRODUCTION have their normal meaning, and peekNode() refers to the InvalidNode
pushed by recovery. I anticipate that we will standardize on one of the notations (!!
or !->
) and remove the other one when we decide which one "works" best in practice. With my experience so far, I think I would vote for !->
.
While the action block option is allowed anywhere the single !
is allowed, it only affects the generated parser in loop recovery.
I want to look at this a little more with respect to non-loop recovery. I'll resubmit when I've done that.
…ction with a fault recovery using either "!!" or "!->" for now.