96b187efdf
Symbols for submodules have `ModuleDetails` with `isSubmodule` set. Scopes for submodules have `Module` kind and have a parent scope that is also `Module` kind. Scopes for modules now contain a mapping of submodule name to scope so that we can find them without having to search the scope tree or re-read their `.mod` file. The module file for submodule `s` with ancestor module `m` is named `m-s.mod`. The tree structure of scopes means module file writing is now recursive. Similarly, reading the module file for a submodule may require reading the module files of its parent and ancestor. `ResolveNames` now requires the parent scope to be passed in -- it is not always the global scope. `test_modfiles.sh` now handles an argument that is a filename glob so that the test can involve multiple files. This allows `modfile09` to test reading of `.mod` files for modules and submodules. Original-commit: flang-compiler/f18@2e4424dbc8 Reviewed-on: https://github.com/flang-compiler/f18/pull/160 Tree-same-pre-rewrite: false
8 lines
91 B
Fortran
8 lines
91 B
Fortran
submodule(m) s1
|
|
integer s1_x
|
|
end
|
|
|
|
!Expect: m-s1.mod
|
|
!submodule(m) s1
|
|
!integer::s1_x
|
|
!end
|