Support lookahead assertions. Given a lookahead expression and a contingent sequence, here's what has to happen:
Make a lookahead state at the engine level. It will essentially be a normal expression state of [lookahead, contingent] with a bit of special sauce in handling success and failure.
- When
lookahead succeeds it must fail the lookahead expression, causing contingent to become the best alternative
- When
lookahead fails the entire lookahead state must fail.
Support lookahead assertions. Given a
lookaheadexpression and acontingentsequence, here's what has to happen:Make a lookahead state at the engine level. It will essentially be a normal expression state of
[lookahead, contingent]with a bit of special sauce in handling success and failure.lookaheadsucceeds it must fail thelookaheadexpression, causingcontingentto become the best alternativelookaheadfails the entire lookahead state must fail.