Improvements to lex and yacc tools #4183
Merged
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.
The mocked tools
mylex.pyandmyyacc.pynow understand the file-generation options, and generate a dummy file with predictable contents, for checking. This allows more testing of the path through the SCons support for these two without needing live commands.New tests added which invoke the file-generation options, and make sure the extra files are created, and that SCons detects and tracks the added targets. Work is done in a subdirectory, which exposes some existing known inconsistent behavior (the regular generated file goes in the subdir per the
LEXCOMandYACCOMgenerated line, while the ones generated from command line options go in the topdir) - but we're going to allow that behavior to continue for backwards compat.Same fix applied to yacc tool that PR #4168 did for lex -
do subst_list()instead ofsubst()to preserve spaces in paths. That fix left the lex tool unable to pass the new test, as it could not see the individual arguments in theFLAGSvariable, which was solved by indexing into the subst'd list so we can iterate over the args again.Test and tool cleanup; add
DefaultEnvironmentcalls, etc.Note this mentions, but does not address the problem described in issue 4154.
Signed-off-by: Mats Wichmann [email protected]
Contributor Checklist:
CHANGES.txt(and read theREADME.rst)