lx: Distinguish between unexpected EOF and EOF in ignored zones (broken by #509) #510
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR #509 introduced a bug: It didn't distinguish between an unexpected end of input and an end of input in a zone that matches but ignores its input. This caused several lxpos tests to fail due to getting a
TOK_UNKNOWN
rather than aTOK_EOF
when the input has trailing whitespace, but I didn't notice until after merging because the normal build doesn't regenerate the code forsrc/lx/lexer.lx
orsrc/libfsm/lexer.lx
. (I had ensured all the libre dialect lexers and parsers were regenerated, but missed those.)Only
src/lx/print/c.c
has code changes, the other files are all generated code updates.Instead of always generating
TOK_UNKNOWN
, this this inspects the zone mappings to determine whether the current end ID represents a dead end for the zone. If not, it should instead generate TOK_EOF.