[Chapel Merge] next: Parse Forall, Foreach, TaskVar, WithClause,

Branch: refs/heads/master
Revision: 34cded4
Author: dlongnecke-cray
Log Message:

Merge pull request #17807 from dlongnecke-cray/next-add-forall

next: Parse Forall, Foreach, TaskVar, WithClause, Zip (#17807)

This is for compiler/next.

Add support for parsing forall loops and foreach loops that appear at
the statement level. Some forms of these loops have with clauses, so
add a WithClause node. Add support for parsing task variables within
a with clause, represented as a new class called TaskVar. While
there, add support for parsing zip() expressions as a freebie.

Rename IndexableLoop::indexVariableDecl to index since we have
removed symbols in favor of decls, and indexDecl is too long.

The Loop constructor now requires numLoopBodyStmts in addition to
loopBodyChildNum. Propagate this info through subclass constructors.

Add withClause() and isExpressionLevel() to IndexableLoop.
Remove such methods from child classes.

Move a bunch of trivial methods for AST nodes into header files.

Add a new header uast/IntentList.h which contains a centralized
list of all intents (e.g. in) and storage kinds (e.g. var).

Individual enum values across Formal, Function, Variable,
and TaskVar are now set to corresponding values listed in
IntentList. This achieves internal consistency across all intent
and kind enums.

Add cases for TaskVar::Intent to testConsistentEnums.

Reviewed by @vasslitvinov and @mppf. Thanks!


  • [x] All compiler/next tests pass

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

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

A compiler/next/include/chpl/uast/Foreach.h
A compiler/next/include/chpl/uast/IntentList.h
A compiler/next/include/chpl/uast/TaskVar.h
A compiler/next/include/chpl/uast/WithClause.h
A compiler/next/include/chpl/uast/Zip.h
A compiler/next/lib/uast/Forall.cpp
A compiler/next/lib/uast/Foreach.cpp
A compiler/next/lib/uast/TaskVar.cpp
A compiler/next/lib/uast/WithClause.cpp
A compiler/next/lib/uast/Zip.cpp
A compiler/next/test/frontend/testParseForall.cpp
A compiler/next/test/frontend/testParseForeach.cpp
M compiler/next/include/chpl/uast/ASTClassesList.h
M compiler/next/include/chpl/uast/For.h
M compiler/next/include/chpl/uast/Formal.h
M compiler/next/include/chpl/uast/Function.h
M compiler/next/include/chpl/uast/IndexableLoop.h
M compiler/next/include/chpl/uast/Loop.h
M compiler/next/include/chpl/uast/Variable.h
M compiler/next/lib/frontend/Parser/ParserContext.h
M compiler/next/lib/frontend/Parser/ParserContextImpl.h
M compiler/next/lib/frontend/Parser/chapel.ypp
M compiler/next/lib/frontend/Parser/lexer-help.h
M compiler/next/lib/frontend/Parser/parser-dependencies.h
M compiler/next/lib/uast/CMakeLists.txt
M compiler/next/lib/uast/For.cpp
M compiler/next/lib/uast/IndexableLoop.cpp
M compiler/next/lib/uast/Loop.cpp
M compiler/next/test/frontend/CMakeLists.txt
M compiler/next/test/frontend/testParseFor.cpp
M compiler/next/test/uast/testConsistentEnums.cpp

Compare: https://github.com/chapel-lang/chapel/compare/8f7b0086f256...34cded4e9e04