mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 07:24:42 +01:00
Use more specific node kinds for literals. (#3419)
Sounding out the approach, to make it clearer what a literal node corresponds to.
This commit is contained in:
@@ -298,7 +298,6 @@ class NodeStack {
|
||||
case Parse::NodeKind::IfExprElse:
|
||||
case Parse::NodeKind::IndexExpr:
|
||||
case Parse::NodeKind::InfixOperator:
|
||||
case Parse::NodeKind::Literal:
|
||||
case Parse::NodeKind::MemberAccessExpr:
|
||||
case Parse::NodeKind::NameExpr:
|
||||
case Parse::NodeKind::ParenExpr:
|
||||
@@ -314,6 +313,11 @@ class NodeStack {
|
||||
case Parse::NodeKind::StructFieldType:
|
||||
case Parse::NodeKind::StructTypeLiteral:
|
||||
case Parse::NodeKind::TupleLiteral:
|
||||
// Use x-macros to handle literal cases.
|
||||
#define CARBON_PARSE_NODE_KIND(...)
|
||||
#define CARBON_PARSE_NODE_KIND_TOKEN_LITERAL(Name, ...) \
|
||||
case Parse::NodeKind::Name:
|
||||
#include "toolchain/parse/node_kind.def"
|
||||
return IdKind::InstId;
|
||||
case Parse::NodeKind::IfCondition:
|
||||
case Parse::NodeKind::IfExprIf:
|
||||
|
||||
Reference in New Issue
Block a user