[Chapel Merge] next: Compile the interopWithC primer with new fro

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

Merge pull request #18541 from dlongnecke-cray/next-add-interop-c-primer

next: Compile the interopWithC primer with new frontend

This is for compiler/next.

Add new uAST nodes, adjust the parser, and tweak the convert-uast pass
as necessary to get the interopWithC primer to pass.

Add the ExternBlock and Require uAST nodes.

Move Function::Linkage to Decl::Linkage.

Adjust all Decl to accept a Decl::Linkage and the position of a
child expression representing the linkageName.

Adjust the parser to thread linkage in a way similar to variable
declaration kind.

Adjust the convert-uast pass to build extern functions, aggregates,
and variables.

Adjust the convert-uast pass to be more flexible when building
BracketLoop nodes that represent array types.

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

TESTING

  • [x] Can build chpl
  • [x] The interopWithC primer with --compiler-library-parser
  • [x] test/release/examples with --compiler-library-parser

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

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

A compiler/next/include/chpl/uast/Require.h
A compiler/next/lib/uast/ExternBlock.cpp
A compiler/next/lib/uast/Require.cpp
A compiler/next/test/parsing/testParseVariables.cpp
M compiler/next/include/chpl/uast/ASTClassesList.h
M compiler/next/include/chpl/uast/AggregateDecl.h
M compiler/next/include/chpl/uast/Class.h
M compiler/next/include/chpl/uast/Decl.h
M compiler/next/include/chpl/uast/Enum.h
M compiler/next/include/chpl/uast/EnumElement.h
M compiler/next/include/chpl/uast/Formal.h
M compiler/next/include/chpl/uast/Function.h
M compiler/next/include/chpl/uast/Module.h
M compiler/next/include/chpl/uast/MultiDecl.h
M compiler/next/include/chpl/uast/NamedDecl.h
M compiler/next/include/chpl/uast/Record.h
M compiler/next/include/chpl/uast/TaskVar.h
M compiler/next/include/chpl/uast/TupleDecl.h
M compiler/next/include/chpl/uast/TypeDecl.h
M compiler/next/include/chpl/uast/Union.h
M compiler/next/include/chpl/uast/VarLikeDecl.h
M compiler/next/include/chpl/uast/Variable.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/bison-chpl-lib.h
M compiler/next/lib/parsing/chpl.ypp
M compiler/next/lib/uast/CMakeLists.txt
M compiler/next/lib/uast/Makefile.include
M compiler/next/lib/uast/MultiDecl.cpp
M compiler/next/lib/uast/Record.cpp
M compiler/next/lib/uast/TupleDecl.cpp
M compiler/next/lib/uast/Union.cpp
M compiler/next/lib/uast/Variable.cpp
M compiler/next/test/parsing/CMakeLists.txt
M compiler/next/test/parsing/testParse.cpp
M compiler/next/test/parsing/testParseAggregate.cpp
M compiler/next/test/parsing/testParseFunctions.cpp
M compiler/passes/convert-uast.cpp

Compare: https://github.com/chapel-lang/chapel/compare/c2d957866a3e...b6c7bb79b10c