mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
[parse] Implement initial parsing support for Lambda expressions (#6583)
This adds the necessary parser infrastructure to recognize and parse lambda expressions in Carbon. Key changes: - Added and Parse Node Kinds. - Updated to use to accommodate the growing number of node kinds. - Implemented parser states and handlers for lambda syntax ( or ). - Added structure to . - Added diagnostics for missing lambda bodies. - Added a stub in phase to defer semantic analysis using . - Added parser tests for lambdas.
This commit is contained in:
@@ -462,6 +462,7 @@ class NodeStack {
|
||||
case Parse::NodeKind::ImplicitParamListStart:
|
||||
case Parse::NodeKind::ImplIntroducer:
|
||||
case Parse::NodeKind::InterfaceIntroducer:
|
||||
case Parse::NodeKind::LambdaIntroducer:
|
||||
case Parse::NodeKind::LetInitializer:
|
||||
case Parse::NodeKind::LetIntroducer:
|
||||
case Parse::NodeKind::NamedConstraintIntroducer:
|
||||
@@ -534,6 +535,7 @@ class NodeStack {
|
||||
case Parse::NodeKind::StructLiteralComma:
|
||||
case Parse::NodeKind::StructFieldDesignator:
|
||||
case Parse::NodeKind::StructTypeLiteralComma:
|
||||
case Parse::NodeKind::TerseBodyArrow:
|
||||
case Parse::NodeKind::TupleLiteralComma:
|
||||
case Parse::NodeKind::WhileCondition:
|
||||
return Id::Kind::Invalid;
|
||||
|
||||
Reference in New Issue
Block a user