Branch: refs/heads/main
Revision: 2068b23
Author: bradcray
Link: Fix support for requires of .chpl files within implicitly used modules by bradcray · Pull Request #18912 · chapel-lang/chapel · GitHub
Log Message:
Merge pull request #18912 from bradcray/fix-chains-of-implicit-uses-and-requires
Fix support for requires of .chpl files within implicitly used modules
[reviewed by @mppf]
BenMcD pointed out in issue #18883 that we were not doing a good job of
parsing files in require
statements that were in implicitly used modules.
This was due to the lack of a loop in the logic that starts parsing dependent
files that weren't explicitly named on the command-file. The fix was
fairly simple: add a loop that continues parsing things while it still
finds new things that need to be parsed. This PR does so and also adds
an extended version of Ben's motivating test that takes the chain one
step further to make sure that it can spin for multiple rounds (I got
it wrong the first time around, so only got one level deep).
In the test, I added a few copies of the modules in subdirectories because
of some vagueness (which I think there may be open issues for) about
whether paths should be relative to the file they live in or the invocation of
the compiler. I didn't make any attempts to mess with the current behavior
here, or even think about it much, but put in some extra copies of the files
in case the behavior changes down the road.
Resolves #18883.
Modified Files:
A test/modules/require/implUseReqChain/B.chpl
A test/modules/require/implUseReqChain/B.notest
A test/modules/require/implUseReqChain/D.chpl
A test/modules/require/implUseReqChain/D.notest
A test/modules/require/implUseReqChain/mixImplUsesAndRequires.chpl
A test/modules/require/implUseReqChain/mixImplUsesAndRequires.good
A test/modules/require/implUseReqChain/subdir.notest
A test/modules/require/implUseReqChain/subdir/C.chpl
A test/modules/require/implUseReqChain/subdir/D.chpl
A test/modules/require/implUseReqChain/subdir/subdir2/E.chpl
A test/modules/require/implUseReqChain/subdir2.notest
A test/modules/require/implUseReqChain/subdir2/E.chpl
M compiler/parser/parser.cpp
Compare: https://github.com/chapel-lang/chapel/compare/ad526fdacd05...2068b2376274