Branch: refs/heads/master
Revision: 88615ce
Author: dlongnecke-cray
Log Message:
Merge pull request #17822 from dlongnecke-cray/next-add-bracket-loop
next: Parse bracket loops at the statement level (#17822)
This is for compiler/next
.
A "bracket loop" is a loop construct that looks like:
[i in 0..15] writeln(i);
A bracket loop is different from a forall loop in that it will try to
use a serial iterator if a parallel iterator is not available.
Add the header BracketLoop
, and parse bracket loops that appear at
a statement level.
Rename usesDo
to usesImplicitBlock
. Remove isBodyBlock
from
the DoWhile
and BracketLoop
nodes. Rewire the parser accordingly.
Clean up parser actions for loops by adding helpers to ParserContext
.
Reviewed by @lydia-duncan and @mppf. Thanks!
TESTING:
- [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/BracketLoop.h
A compiler/next/lib/uast/BracketLoop.cpp
A compiler/next/test/frontend/testParseBracketLoop.cpp
M compiler/next/include/chpl/uast/ASTClassesList.h
M compiler/next/include/chpl/uast/DoWhile.h
M compiler/next/include/chpl/uast/For.h
M compiler/next/include/chpl/uast/Forall.h
M compiler/next/include/chpl/uast/Foreach.h
M compiler/next/include/chpl/uast/IndexableLoop.h
M compiler/next/include/chpl/uast/Local.h
M compiler/next/include/chpl/uast/Loop.h
M compiler/next/include/chpl/uast/Serial.h
M compiler/next/include/chpl/uast/While.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/parser-dependencies.h
M compiler/next/lib/uast/CMakeLists.txt
M compiler/next/lib/uast/DoWhile.cpp
M compiler/next/lib/uast/For.cpp
M compiler/next/lib/uast/Forall.cpp
M compiler/next/lib/uast/Foreach.cpp
M compiler/next/lib/uast/Local.cpp
M compiler/next/lib/uast/Loop.cpp
M compiler/next/lib/uast/Serial.cpp
M compiler/next/lib/uast/While.cpp
M compiler/next/test/frontend/CMakeLists.txt
M compiler/next/test/frontend/testParseDoWhile.cpp
M compiler/next/test/frontend/testParseFor.cpp
M compiler/next/test/frontend/testParseForall.cpp
M compiler/next/test/frontend/testParseForeach.cpp
M compiler/next/test/frontend/testParseLocal.cpp
M compiler/next/test/frontend/testParseSerial.cpp
M compiler/next/test/frontend/testParseWhile.cpp
Compare: https://github.com/chapel-lang/chapel/compare/d1d65d9c0311...88615ce16494