Fix variable expansion issue #145 #149
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.
Fixes: #145
Updates test case: #146
Supersedes: #148
This refactors the
Loaderto accept an existingParserinstance. The change fixes the issue by creating a new parser that inherits variables from the parent environment and recursively calls itself as needed.subninjanow behaves as intended according to reference Ninja. However, changes made inincluded files currently don’t propagate back to the parent environment as they normally should. Although this technically changes behavior, #145 hasn't been reported before now, suggesting it's not a common case. I tested this against several projects generated by Meson and CMake, including LLVM/Clang, and didn’t encounter any new bugs or regressions.I ran into borrow checking issues when trying to handle the aforementioned
includescope issue (see TODO comment), and since I’m not familiar with Rust—which is why I originally offloaded this issue—I left that part for follow-up work. I figure this is fine since it already wasn't implemented.Sorry for the delay and PR ping-pong.