[toolchain] Parsing support for tuple literal syntax. (#694)

For now, we permit non-empty tuples to have trailing commas, and require
a trailing comma if there's exactly one list element. The exact rule
here has not yet been decided.
This commit is contained in:
Richard Smith
2021-08-02 16:18:18 -07:00
committed by GitHub
parent a83c22288f
commit b1993a6cd0
4 changed files with 73 additions and 21 deletions
+3
View File
@@ -43,6 +43,9 @@ CARBON_PARSE_NODE_KIND(StatementEnd)
// Expressions.
CARBON_PARSE_NODE_KIND(Literal)
CARBON_PARSE_NODE_KIND(TupleLiteral)
CARBON_PARSE_NODE_KIND(TupleLiteralComma)
CARBON_PARSE_NODE_KIND(TupleLiteralEnd)
CARBON_PARSE_NODE_KIND(NameReference)
CARBON_PARSE_NODE_KIND(ParenExpression)
CARBON_PARSE_NODE_KIND(ParenExpressionEnd)