-
-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
When hand-rolling multi-byte peeks via something like this:
const invoke_lookahead_backslash = (
preserved: source.node.Node,
escaped: source.node.Node,
stripped: source.node.Node,
) => {
const pause = p.pause(LlpkgcError.Lookahead, 'Lookahead required')
const invoke = p.invoke(lookahead_func, {
0: preserved,
1: escaped,
2: stripped
}, lookahead_error)
pause.otherwise(invoke)
return invoke
}
This creates a loop which is fine in most contexts, because there exists mechanisms to advance in some of those nodes.
However in the root node (or any node reachable from the root via no-advance edges), any character which is peek()'d instead of match()'d will cause the loop analysis to fail here on the pause loop. In this case the \, which is what I'm interested in, because it will either be a part of a span or not depending on the following character.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels