[toolchain] Implement lexing and parsing support for #543. (#693)

Lex [iuf][1-9][0-9]* as a new kind of "sized type literal" token. When
parsing that token, form a literal expression.

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
This commit is contained in:
Richard Smith
2021-08-02 15:37:43 -07:00
committed by GitHub
co-authored by Chandler Carruth
parent 9829f188b7
commit a83c22288f
8 changed files with 257 additions and 65 deletions
+3
View File
@@ -678,6 +678,9 @@ auto ParseTree::Parser::ParsePrimaryExpression() -> llvm::Optional<Node> {
case TokenKind::IntegerLiteral():
case TokenKind::RealLiteral():
case TokenKind::StringLiteral():
case TokenKind::IntegerTypeLiteral():
case TokenKind::UnsignedIntegerTypeLiteral():
case TokenKind::FloatingPointTypeLiteral():
kind = ParseNodeKind::Literal();
break;