Branch: refs/heads/main
Revision: fcbd194
Author: mppf
Link: compiler/next: parse modules on use/import by mppf · Pull Request #19134 · chapel-lang/chapel · GitHub
Log Message:
Merge pull request #19134 from mppf/next-parse-imported
compiler/next: parse modules on use/import
Resolves https://github.com/Cray/chapel-private/issues/2637
This PR adjusts the compiler/next code to handle parsing a module on a
use/import.
- adds a settable module search path (
moduleSearchPath
/
setModuleSearchPath
) to parsing-queries.h - to avoid polluting the unique strings map with pathname components,
adjustedfileText
,setFileText
to accept the path as a
std::string
- added
hasFileText
for use when testing to see if a file at a
particular path is already known to the compiler fromsetFileText
-
getToplevelModule
can now find modules using the module search path.
When it does so, it checks ifsetFileText
has already indicated the
file at a particular path (by callinghasFileText
); if not it uses a
new file system call to check if the file exists at the various module
path locations. ThehasFileText
enables C++ tests of the use/import
parsing to work without storing anything in the filesystem. - Moved the implementation of
Context::setFilePathForModuleID
closer
to the related functions and addedContext::hasCurrentResultForQuery
for use inhasFileText
and similar.
Reviewed by @dlongnecke-cray - thanks!
-
[x] full local testing
Modified Files:
M compiler/next/include/chpl/parsing/parsing-queries.h
M compiler/next/include/chpl/queries/Context.h
M compiler/next/include/chpl/queries/query-impl.h
M compiler/next/include/chpl/util/filesystem.h
M compiler/next/lib/parsing/parsing-queries.cpp
M compiler/next/lib/queries/Context.cpp
M compiler/next/lib/util/filesystem.cpp
M compiler/next/test/parsing/testParsingQueries.cpp
M compiler/next/test/resolution/testInteractive.cpp
M compiler/next/test/resolution/testScopeResolve.cppCompare: Comparing 2005de5b2293...fcbd194466bc · chapel-lang/chapel · GitHub