Branch: refs/heads/master
Revision: e662f5e
Author: mppf
Log Message:
Merge pull request #17680 from mppf/variable-multi-decl
compiler/next: MultiDecl
Add MultiDecl AST, parse it, and test for it.
MultiDecl represents a declaration for
multiple variables.
E.g.
var a, b:int, c, d = 1;
var x: int, y = 3, z: real;
Each of the lines above is represented by a MultiDecl containing a
list of VariableDecls. Note that the initial value and/or type is inferred
from later declarations.
Since the MultiDecl does not declare a Sym itself, it is not a
subclass of Decl. Rather, it contains several VariableDecls.
Besides the above, this PR comments out the SimpleType AST node from
ASTClassesList because I am currently thinking we won't need it (because
we don't ever define things like int
in the module code). However I am
leaving it there as a comment in case it turns out to be necessary.
Reviewed by @vasslitvinov - thanks!
Modified Files:
A compiler/next/include/chpl/uast/MultiDecl.h
A compiler/next/include/chpl/uast/SymDecl.h
A compiler/next/lib/uast/MultiDecl.cpp
A compiler/next/lib/uast/SymDecl.cpp
A compiler/next/test/frontend/testParseMultiVar.cpp
M compiler/next/include/chpl/frontend/frontend-queries.h
M compiler/next/include/chpl/uast/ASTClassesList.h
M compiler/next/include/chpl/uast/Decl.h
M compiler/next/include/chpl/uast/FormalDecl.h
M compiler/next/include/chpl/uast/Function.h
M compiler/next/include/chpl/uast/FunctionDecl.h
M compiler/next/include/chpl/uast/ModuleDecl.h
M compiler/next/include/chpl/uast/VariableDecl.h
M compiler/next/lib/frontend/Parser/chapel.ypp
M compiler/next/lib/frontend/Parser/parser-dependencies.h
M compiler/next/lib/frontend/frontend-queries.cpp
M compiler/next/lib/uast/ASTNode.cpp
M compiler/next/lib/uast/Builder.cpp
M compiler/next/lib/uast/CMakeLists.txt
M compiler/next/lib/uast/FormalDecl.cpp
M compiler/next/lib/uast/FunctionDecl.cpp
M compiler/next/lib/uast/ModuleDecl.cpp
M compiler/next/lib/uast/VariableDecl.cpp
M compiler/next/test/frontend/CMakeLists.txt
Compare: https://github.com/chapel-lang/chapel/compare/092cf5562e37...e662f5e08d6e