Implement parsing observe declarations (#6674)

This implements parsing of the
[`observe`](https://docs.carbon-lang.dev/docs/design/generics/details.html#observing-a-type-implements-an-interface)
declarations.

- Added states and node kinds.
- Added node categories.
- Added a diagnostic for invalid keywords/operators.
- Implemented parser state handlers.
- Added structs to `typed_nodes.h`.
- Added parser tests.
This commit is contained in:
Özgür
2026-02-26 19:21:19 +00:00
committed by GitHub
parent 34651f429f
commit d11ee4b2b1
16 changed files with 407 additions and 16 deletions
+3
View File
@@ -467,6 +467,7 @@ class NodeStack {
case Parse::NodeKind::LetInitializer:
case Parse::NodeKind::LetIntroducer:
case Parse::NodeKind::NamedConstraintIntroducer:
case Parse::NodeKind::ObserveIntroducer:
case Parse::NodeKind::RefBindingName:
case Parse::NodeKind::ReturnStatementStart:
case Parse::NodeKind::StructLiteralStart:
@@ -527,6 +528,8 @@ class NodeStack {
case Parse::NodeKind::MatchIntroducer:
case Parse::NodeKind::MatchStatementStart:
case Parse::NodeKind::NamespaceStart:
case Parse::NodeKind::ObserveEqualEqual:
case Parse::NodeKind::ObserveImpls:
case Parse::NodeKind::PackageIntroducer:
case Parse::NodeKind::ParenExprStart:
case Parse::NodeKind::PatternListComma: