You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unhandled TOK_ERROR for incompletely parsed unsupported backtracking control flags #386
This appears to be because the lexer expects a ) to close the backtracking control flags, but if the '(*' .. ')' {} in lx does not get the closing ')' it just returns TOK_ERROR, and the parser does not have a catch-all error handler at the right layer -- the very first thing the generated parser's point of entry does is return if the current terminal is the error token. This misses the other error handlers, so the assertion that if parsing did not produce an expression, an error code is set fails shortly after.
I spent a bit trying to flag the error properly in the parser, but I'm not that familiar with sid. Adding a TOK_ERROR check in parser.act between ADVANCE_LEXER; and DIALECT_ENTRY catches it, but seems hacky. There also doesn't seem to be a clearly appropriate error code -- RE_EXSUB ("expected sub-expression") may be the closest.
Similarly, the intermediate steps for other multi-character tokens with .., will trigger the same assert -- (*C (for (*CR), (*P, (*pos, (?<, and so on. A catch-all error hander for TOK_ERROR should address all of these.
Activity
silentbicycle commentedon Oct 20, 2022
Similarly, the intermediate steps for other multi-character tokens with
.., will trigger the same assert --(*C(for(*CR),(*P,(*pos,(?<, and so on. A catch-all error hander forTOK_ERRORshould address all of these.parser.act: Avoid crash in parser from '(*:'.
parser.act: Avoid crash in parser from '(*:'.
parser.act: Avoid crash in parser from '(*:'.
parser.act: Avoid crash in parser from '(*:'.
lx: Handle unexpected EOF in pattern pairs. Add tests, update out6.dump.