Branch: refs/heads/master
Revision: 6494765
Author: mppf
Log Message:
Merge pull request #17850 from mppf/next-literals
compiler/next: string and numeric literals
This PR adds uAST classes for:
- StringLiteral
- BytesLiteral
- CStringLiteral
- IntLiteral
- UintLiteral
- RealLiteral
- ImagLiteral
These are all subclasses of Literal. The idea here is that since we
already have polymorphism from the AST node inheritance we don't need to
have a union also for the types. Currently we have a different uAST type
for each type of literal (type as in int
uint
string
etc).
Originally, I had been thinking this effort would use the compiler/ifa
code right away, but since simply representing the literal values does
not require any computation be done on them, I opted not to do that yet.
I think that ifa
code will still be important when evaluating param
expressions.
- [x] make test-libchplcomp passes
- [x] full local testing
Reviewed by @lydia-duncan and @stonea - thanks!
Modified Files:
A compiler/next/include/chpl/uast/BytesLiteral.h
A compiler/next/include/chpl/uast/CStringLiteral.h
A compiler/next/include/chpl/uast/ImagLiteral.h
A compiler/next/include/chpl/uast/IntLiteral.h
A compiler/next/include/chpl/uast/NumericLiteral.h
A compiler/next/include/chpl/uast/RealLiteral.h
A compiler/next/include/chpl/uast/StringLikeLiteral.h
A compiler/next/include/chpl/uast/StringLiteral.h
A compiler/next/include/chpl/uast/UintLiteral.h
A compiler/next/lib/uast/BytesLiteral.cpp
A compiler/next/lib/uast/CStringLiteral.cpp
A compiler/next/lib/uast/ImagLiteral.cpp
A compiler/next/lib/uast/IntLiteral.cpp
A compiler/next/lib/uast/Literal.cpp
A compiler/next/lib/uast/NumericLiteral.cpp
A compiler/next/lib/uast/RealLiteral.cpp
A compiler/next/lib/uast/StringLikeLiteral.cpp
A compiler/next/lib/uast/StringLiteral.cpp
A compiler/next/lib/uast/UintLiteral.cpp
A compiler/next/test/frontend/testParseNumericLiterals.cpp
A compiler/next/test/frontend/testParseStringBytesLiterals.cpp
M compiler/next/include/chpl/uast/ASTClassesList.h
M compiler/next/include/chpl/uast/Comment.h
M compiler/next/include/chpl/uast/Literal.h
M compiler/next/lib/frontend/Parser/ParserContext.h
M compiler/next/lib/frontend/Parser/ParserContextImpl.h
M compiler/next/lib/frontend/Parser/bison-chpl-lib.cpp
M compiler/next/lib/frontend/Parser/bison-chpl-lib.h
M compiler/next/lib/frontend/Parser/chpl.ypp
M compiler/next/lib/frontend/Parser/lexer-help.h
M compiler/next/lib/frontend/Parser/parser-dependencies.h
M compiler/next/lib/frontend/Parser/parser-help.h
M compiler/next/lib/uast/CMakeLists.txt
M compiler/next/lib/uast/Comment.cpp
M compiler/next/lib/uast/Makefile.include
M compiler/next/test/frontend/CMakeLists.txt
Compare: https://github.com/chapel-lang/chapel/compare/8b034d2971d8...6494765d808d