[Chapel Merge] next: Add support for parsing import statements

Branch: refs/heads/main
Revision: d24461d
Author: dlongnecke-cray
Log Message:

Merge pull request #18044 from dlongnecke-cray/next-add-import

next: Add support for parsing import statements

This is for compiler/next.

This PR adds support for parsing import statements. It represents
them with a new uAST node called Import. An import statement
contains one or more visibility clauses of type VisibilityClause.

Rename UseClause to VisibilityClause and use it to represent the
contents of both use and import statements.

Add a new LimitationKind to VisibilityClause that is called
BRACES. This represents the unqualified lists that can occur
for symbols in import statements.

Add a test for parsing import statements.

Reviewed by @mppf, @lydia-duncan. Thanks!


  • [x] Can build chpl
  • [x] All compiler/next tests pass
  • [x] All hellos in test/release/examples pass

Signed-off-by: David Longnecker dlongnecke-cray@users.noreply.github.com

Modified Files:
A compiler/next/include/chpl/uast/Import.h

A compiler/next/include/chpl/uast/VisibilityClause.h
A compiler/next/lib/uast/Import.cpp
A compiler/next/lib/uast/VisibilityClause.cpp
A compiler/next/test/parsing/testParseImport.cpp
R compiler/next/include/chpl/uast/UseClause.h
R compiler/next/lib/uast/UseClause.cpp
M compiler/next/include/chpl/uast/ASTClassesList.h
M compiler/next/include/chpl/uast/Use.h
M compiler/next/include/chpl/uast/all-uast.h
M compiler/next/lib/parsing/ParserContext.h
M compiler/next/lib/parsing/ParserContextImpl.h
M compiler/next/lib/parsing/bison-chpl-lib.cpp
M compiler/next/lib/parsing/chpl.ypp
M compiler/next/lib/resolution/scope-queries.cpp
M compiler/next/lib/uast/CMakeLists.txt
M compiler/next/lib/uast/Makefile.include
M compiler/next/lib/uast/Use.cpp
M compiler/next/test/parsing/CMakeLists.txt
M compiler/next/test/parsing/testParseUse.cpp
M compiler/passes/convert-uast.cpp

Compare: https://github.com/chapel-lang/chapel/compare/7f4ab70f4f00...d24461d6a796