Implement checking observe declarations (#6709)

This adds SemIR structs and implements building `observe` lists, as well
as naming, formatting, and importing `observe` declarations.

---------

Co-authored-by: Dana Jansens <danakj@orodu.net>
This commit is contained in:
Özgür T. Önsoy
2026-07-08 17:07:10 +00:00
committed by GitHub
co-authored by Dana Jansens
parent 918bb9364f
commit 08385adeb5
713 changed files with 13013 additions and 13 deletions
+3 -3
View File
@@ -392,6 +392,8 @@ class NodeStack {
Id::KindFor<SemIR::InstId>());
set_id_if_category_is(Parse::NodeCategory::Expr,
Id::KindFor<SemIR::InstId>());
set_id_if_category_is(Parse::NodeCategory::ObserveOperator,
Id::KindFor<SemIR::InstId>());
set_id_if_category_is(
Parse::NodeCategory::MemberName | Parse::NodeCategory::NonExprName,
Id::KindFor<SemIR::NameId>());
@@ -415,6 +417,7 @@ class NodeStack {
switch (node_kind) {
case Parse::NodeKind::CallExprStart:
case Parse::NodeKind::IfExprThen:
case Parse::NodeKind::ObserveIntroducer:
case Parse::NodeKind::RequireIntroducer:
case Parse::NodeKind::ShortCircuitOperandAnd:
case Parse::NodeKind::ShortCircuitOperandOr:
@@ -462,7 +465,6 @@ 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:
@@ -524,8 +526,6 @@ 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: