Repository navigation
Avoid false Fortran dependencies in comments - #4942
Merged
bdbaddog merged 3 commits intoOct 28, 2026
Merged
Conversation
Refs SCons#4454 Assisted-by: OpenAI Codex (GPT-6.1) Signed-off-by: boulea7 <zln1905391059@163.com>
Keep synthetic output byte-for-byte on Windows, where text writes translate LF to CRLF and fail binary content checks. Refs SCons#4454 Assisted-by: OpenAI Codex (GPT-6.1) Signed-off-by: boulea7 <zln1905391059@163.com>
Collaborator
|
This seems to be about #4454 |
The scanner ran its USE and MODULE regexes over the raw source, so a literal such as PRINT *, 'x; USE foo' produced a false dependency on foo.mod. _strip_comments() can now mask the contents of character literals. USE and MODULE are matched against the masked text, while INCLUDE still uses the literal contents for its quoted filenames. The masked pass is skipped when the stripped text has no quote characters, since masking would change nothing. A fixed-form C, c or * comment line inside a continued literal is now dropped instead of being kept raw. Refs SCons#4454 Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Contributor
|
claude found a few more corner cases and suggested knocking this one off. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Refs #4454
Ignore
USEandINCLUDEtext inside!comments so changes to commented-out dependencies no longer trigger a rebuild. Preserve quoted include paths and continued character literals while retaining module filtering and cached dependencies.The scanner still cannot reliably distinguish fixed and free source forms. A possible fixed-form continuation marker in column 6 is preserved, so the column-6
!ambiguity remains.Validation:
python runtest.py SCons/Scanner/FortranTests.py test/Fortran/scan-comments.pypasses (24 unit tests and the incremental rebuild regression). The rebuild regression fails on the unmodified scanner. Compiler-backed Fortran tests and ruff were not run locally because neither is installed.Contributor Checklist:
CHANGES.txtandRELEASE.txt(and read theREADME.rst).Assisted-by: OpenAI Codex (GPT-6.1)