diff --git a/common/enum_base.h b/common/enum_base.h index b353eb623287..f0503b08d86a 100644 --- a/common/enum_base.h +++ b/common/enum_base.h @@ -32,7 +32,7 @@ namespace Carbon::Internal { // // class MyKind : public CARBON_ENUM_BASE(MyKind) { // public: -// #define CARBON_MY_KIND(Name) CARBON_ENUM_CONSTANT_DECLARATION(Name) +// #define CARBON_MY_KIND(Name) CARBON_ENUM_CONSTANT_DECL(Name) // #include ".../my_kind.def" // // // OPTIONAL: To support converting to and from the underlying type of @@ -205,7 +205,7 @@ class EnumBase : public Printable { // Use this within the Carbon enum class body to generate named constant // declarations for each value. -#define CARBON_ENUM_CONSTANT_DECLARATION(Name) static const EnumType Name; +#define CARBON_ENUM_CONSTANT_DECL(Name) static const EnumType Name; // Use this immediately after the Carbon enum class body to define each named // constant. diff --git a/common/enum_base_test.cpp b/common/enum_base_test.cpp index a8d321631cf6..df22f8dc58e2 100644 --- a/common/enum_base_test.cpp +++ b/common/enum_base_test.cpp @@ -19,7 +19,7 @@ CARBON_DEFINE_RAW_ENUM_CLASS(TestKind, uint8_t) { class TestKind : public CARBON_ENUM_BASE(TestKind) { public: -#define CARBON_ENUM_BASE_TEST_KIND(Name) CARBON_ENUM_CONSTANT_DECLARATION(Name) +#define CARBON_ENUM_BASE_TEST_KIND(Name) CARBON_ENUM_CONSTANT_DECL(Name) #include "common/enum_base_test.def" using EnumBase::AsInt; diff --git a/explorer/ast/ast_rtti.h b/explorer/ast/ast_rtti.h index 3b6dc9c42510..b9faa8fe0bce 100644 --- a/explorer/ast/ast_rtti.h +++ b/explorer/ast/ast_rtti.h @@ -35,7 +35,7 @@ class AstRttiNodeKind : public CARBON_ENUM_BASE(AstRttiNodeKind) { // other enumerations to match, and to implement range checks. using EnumBase::AsInt; - CARBON_AST_FOR_EACH_FINAL_CLASS(CARBON_ENUM_CONSTANT_DECLARATION) + CARBON_AST_FOR_EACH_FINAL_CLASS(CARBON_ENUM_CONSTANT_DECL) }; // Define the constant members for AstRttiNodeKind. diff --git a/explorer/interpreter/builtins.h b/explorer/interpreter/builtins.h index d983ac1c63fd..659480b2b4f5 100644 --- a/explorer/interpreter/builtins.h +++ b/explorer/interpreter/builtins.h @@ -26,7 +26,7 @@ CARBON_DEFINE_RAW_ENUM_CLASS(Builtin, int) { class Builtin : public CARBON_ENUM_BASE(Builtin) { public: -#define CARBON_BUILTIN(Name) CARBON_ENUM_CONSTANT_DECLARATION(Name) +#define CARBON_BUILTIN(Name) CARBON_ENUM_CONSTANT_DECL(Name) #include "explorer/interpreter/builtins.def" static const int NumBuiltins; diff --git a/language_server/language_server.cpp b/language_server/language_server.cpp index 03b24c2bd8e4..502becbad95d 100644 --- a/language_server/language_server.cpp +++ b/language_server/language_server.cpp @@ -106,7 +106,7 @@ void LanguageServer::OnDocumentSymbol( for (const auto& node : parsed.postorder()) { clang::clangd::SymbolKind symbol_kind; switch (parsed.node_kind(node)) { - case Parse::NodeKind::FunctionDeclaration: + case Parse::NodeKind::FunctionDecl: case Parse::NodeKind::FunctionDefinitionStart: symbol_kind = clang::clangd::SymbolKind::Function; break; diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index b4059738798f..1030e7170e86 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -32,7 +32,7 @@ Context::Context(const Lex::TokenizedBuffer& tokens, DiagnosticEmitter& emitter, inst_block_stack_("inst_block_stack_", sem_ir, vlog_stream), params_or_args_stack_("params_or_args_stack_", sem_ir, vlog_stream), args_type_info_stack_("args_type_info_stack_", sem_ir, vlog_stream), - declaration_name_stack_(this) { + decl_name_stack_(this) { // Inserts the "Error" and "Type" types as "used types" so that // canonicalization can skip them. We don't emit either for lowering. canonical_types_.insert({SemIR::InstId::BuiltinError, SemIR::TypeId::Error}); @@ -78,13 +78,13 @@ auto Context::AddInstAndPush(Parse::Node parse_node, SemIR::Inst inst) -> void { auto Context::DiagnoseDuplicateName(Parse::Node parse_node, SemIR::InstId prev_def_id) -> void { - CARBON_DIAGNOSTIC(NameDeclarationDuplicate, Error, + CARBON_DIAGNOSTIC(NameDeclDuplicate, Error, "Duplicate name being declared in the same scope."); - CARBON_DIAGNOSTIC(NameDeclarationPrevious, Note, + CARBON_DIAGNOSTIC(NameDeclPrevious, Note, "Name is previously declared here."); auto prev_def = insts().Get(prev_def_id); - emitter_->Build(parse_node, NameDeclarationDuplicate) - .Note(prev_def.parse_node(), NameDeclarationPrevious) + emitter_->Build(parse_node, NameDeclDuplicate) + .Note(prev_def.parse_node(), NameDeclPrevious) .Emit(); } @@ -107,7 +107,7 @@ auto Context::NoteIncompleteClass(SemIR::ClassId class_id, builder.Note(insts().Get(class_info.definition_id).parse_node(), ClassIncompleteWithinDefinition); } else { - builder.Note(insts().Get(class_info.declaration_id).parse_node(), + builder.Note(insts().Get(class_info.decl_id).parse_node(), ClassForwardDeclaredHere); } } @@ -128,10 +128,8 @@ auto Context::AddNameToLookup(Parse::Node name_node, SemIR::NameId name_id, } } -auto Context::LookupNameInDeclaration(Parse::Node parse_node, - SemIR::NameId name_id, - SemIR::NameScopeId scope_id) - -> SemIR::InstId { +auto Context::LookupNameInDecl(Parse::Node parse_node, SemIR::NameId name_id, + SemIR::NameScopeId scope_id) -> SemIR::InstId { if (scope_id == SemIR::NameScopeId::Invalid) { // Look for a name in the current scope only. There are two cases where the // name would be in an outer scope: @@ -298,7 +296,7 @@ auto Context::GetConstantValue(SemIR::InstId inst_id) -> SemIR::InstId { break; case SemIR::Field::Kind: - case SemIR::FunctionDeclaration::Kind: + case SemIR::FunctionDecl::Kind: return inst_id; default: @@ -398,7 +396,7 @@ auto Context::AddCurrentCodeBlockToFunction(Parse::Node parse_node) -> void { auto function_id = insts() - .GetAs(return_scope_stack().back()) + .GetAs(return_scope_stack().back()) .function_id; functions() .Get(function_id) @@ -785,13 +783,13 @@ class TypeCompleter { case SemIR::BranchIf::Kind: case SemIR::BranchWithArg::Kind: case SemIR::Call::Kind: - case SemIR::ClassDeclaration::Kind: + case SemIR::ClassDecl::Kind: case SemIR::ClassFieldAccess::Kind: case SemIR::ClassInit::Kind: case SemIR::Converted::Kind: case SemIR::Dereference::Kind: case SemIR::Field::Kind: - case SemIR::FunctionDeclaration::Kind: + case SemIR::FunctionDecl::Kind: case SemIR::InitializeFrom::Kind: case SemIR::IntegerLiteral::Kind: case SemIR::NameReference::Kind: diff --git a/toolchain/check/context.h b/toolchain/check/context.h index 65579073e22f..1a588715e71f 100644 --- a/toolchain/check/context.h +++ b/toolchain/check/context.h @@ -58,8 +58,8 @@ class Context { // Performs name lookup in a specified scope for a name appearing in a // declaration, returning the referenced instruction. If scope_id is invalid, // uses the current contextual scope. - auto LookupNameInDeclaration(Parse::Node parse_node, SemIR::NameId name_id, - SemIR::NameScopeId scope_id) -> SemIR::InstId; + auto LookupNameInDecl(Parse::Node parse_node, SemIR::NameId name_id, + SemIR::NameScopeId scope_id) -> SemIR::InstId; // Performs an unqualified name lookup, returning the referenced instruction. auto LookupUnqualifiedName(Parse::Node parse_node, SemIR::NameId name_id) @@ -267,9 +267,7 @@ class Context { return break_continue_stack_; } - auto declaration_name_stack() -> DeclarationNameStack& { - return declaration_name_stack_; - } + auto decl_name_stack() -> DeclNameStack& { return decl_name_stack_; } // Directly expose SemIR::File data accessors for brevity in calls. auto identifiers() -> StringStoreWrapper& { @@ -324,8 +322,8 @@ class Context { // The instruction associated with this entry, if any. This can be one of: // - // - A `ClassDeclaration`, for a class definition scope. - // - A `FunctionDeclaration`, for the outermost scope in a function + // - A `ClassDecl`, for a class definition scope. + // - A `FunctionDecl`, for the outermost scope in a function // definition. // - Invalid, for any other scope. SemIR::InstId scope_inst_id; @@ -408,7 +406,7 @@ class Context { InstBlockStack args_type_info_stack_; // A stack of return scopes; i.e., targets for `return`. Inside a function, - // this will be a FunctionDeclaration. + // this will be a FunctionDecl. llvm::SmallVector return_scope_stack_; // A stack of `break` and `continue` targets. @@ -426,7 +424,7 @@ class Context { ScopeIndex next_scope_index_ = ScopeIndex(0); // The stack used for qualified declaration name construction. - DeclarationNameStack declaration_name_stack_; + DeclNameStack decl_name_stack_; // Maps identifiers to name lookup results. Values are a stack of name lookup // results in the ancestor scopes. This offers constant-time lookup of names, diff --git a/toolchain/check/declaration_name_stack.cpp b/toolchain/check/declaration_name_stack.cpp index bc8e57d626b5..c45a860218dc 100644 --- a/toolchain/check/declaration_name_stack.cpp +++ b/toolchain/check/declaration_name_stack.cpp @@ -8,34 +8,32 @@ namespace Carbon::Check { -auto DeclarationNameStack::MakeEmptyNameContext() -> NameContext { +auto DeclNameStack::MakeEmptyNameContext() -> NameContext { return NameContext{.enclosing_scope = context_->current_scope_index(), .target_scope_id = context_->current_scope_id()}; } -auto DeclarationNameStack::MakeUnqualifiedName(Parse::Node parse_node, - SemIR::NameId name_id) - -> NameContext { +auto DeclNameStack::MakeUnqualifiedName(Parse::Node parse_node, + SemIR::NameId name_id) -> NameContext { NameContext context = MakeEmptyNameContext(); ApplyNameQualifierTo(context, parse_node, name_id); return context; } -auto DeclarationNameStack::PushScopeAndStartName() -> void { - declaration_name_stack_.push_back(MakeEmptyNameContext()); +auto DeclNameStack::PushScopeAndStartName() -> void { + decl_name_stack_.push_back(MakeEmptyNameContext()); } -auto DeclarationNameStack::FinishName() -> NameContext { - CARBON_CHECK(declaration_name_stack_.back().state != - NameContext::State::Finished) +auto DeclNameStack::FinishName() -> NameContext { + CARBON_CHECK(decl_name_stack_.back().state != NameContext::State::Finished) << "Finished name twice"; if (context_->parse_tree().node_kind( context_->node_stack().PeekParseNode()) == - Parse::NodeKind::QualifiedDeclaration) { - // Any parts from a QualifiedDeclaration will already have been processed + Parse::NodeKind::QualifiedDecl) { + // Any parts from a QualifiedDecl will already have been processed // into the name. context_->node_stack() - .PopAndDiscardSoloParseNode(); + .PopAndDiscardSoloParseNode(); } else { // The name had no qualifiers, so we need to process the node now. auto [parse_node, name_id] = @@ -43,22 +41,20 @@ auto DeclarationNameStack::FinishName() -> NameContext { ApplyNameQualifier(parse_node, name_id); } - NameContext result = declaration_name_stack_.back(); - declaration_name_stack_.back().state = NameContext::State::Finished; + NameContext result = decl_name_stack_.back(); + decl_name_stack_.back().state = NameContext::State::Finished; return result; } -auto DeclarationNameStack::PopScope() -> void { - CARBON_CHECK(declaration_name_stack_.back().state == - NameContext::State::Finished) +auto DeclNameStack::PopScope() -> void { + CARBON_CHECK(decl_name_stack_.back().state == NameContext::State::Finished) << "Missing call to FinishName before PopScope"; - context_->PopToScope(declaration_name_stack_.back().enclosing_scope); - declaration_name_stack_.pop_back(); + context_->PopToScope(decl_name_stack_.back().enclosing_scope); + decl_name_stack_.pop_back(); } -auto DeclarationNameStack::LookupOrAddName(NameContext name_context, - SemIR::InstId target_id) - -> SemIR::InstId { +auto DeclNameStack::LookupOrAddName(NameContext name_context, + SemIR::InstId target_id) -> SemIR::InstId { switch (name_context.state) { case NameContext::State::Error: // The name is invalid and a diagnostic has already been emitted. @@ -94,25 +90,25 @@ auto DeclarationNameStack::LookupOrAddName(NameContext name_context, } } -auto DeclarationNameStack::AddNameToLookup(NameContext name_context, - SemIR::InstId target_id) -> void { +auto DeclNameStack::AddNameToLookup(NameContext name_context, + SemIR::InstId target_id) -> void { auto existing_inst_id = LookupOrAddName(name_context, target_id); if (existing_inst_id.is_valid()) { context_->DiagnoseDuplicateName(name_context.parse_node, existing_inst_id); } } -auto DeclarationNameStack::ApplyNameQualifier(Parse::Node parse_node, - SemIR::NameId name_id) -> void { - ApplyNameQualifierTo(declaration_name_stack_.back(), parse_node, name_id); +auto DeclNameStack::ApplyNameQualifier(Parse::Node parse_node, + SemIR::NameId name_id) -> void { + ApplyNameQualifierTo(decl_name_stack_.back(), parse_node, name_id); } -auto DeclarationNameStack::ApplyNameQualifierTo(NameContext& name_context, - Parse::Node parse_node, - SemIR::NameId name_id) -> void { +auto DeclNameStack::ApplyNameQualifierTo(NameContext& name_context, + Parse::Node parse_node, + SemIR::NameId name_id) -> void { if (CanResolveQualifier(name_context, parse_node)) { // For identifier nodes, we need to perform a lookup on the identifier. - auto resolved_inst_id = context_->LookupNameInDeclaration( + auto resolved_inst_id = context_->LookupNameInDecl( name_context.parse_node, name_id, name_context.target_scope_id); if (!resolved_inst_id.is_valid()) { // Invalid indicates an unresolved name. Store it and return. @@ -129,15 +125,14 @@ auto DeclarationNameStack::ApplyNameQualifierTo(NameContext& name_context, } } -auto DeclarationNameStack::UpdateScopeIfNeeded(NameContext& name_context) - -> void { +auto DeclNameStack::UpdateScopeIfNeeded(NameContext& name_context) -> void { // This will only be reached for resolved instructions. We update the target // scope based on the resolved type. auto resolved_inst = context_->insts().Get(name_context.resolved_inst_id); switch (resolved_inst.kind()) { - case SemIR::ClassDeclaration::Kind: { + case SemIR::ClassDecl::Kind: { const auto& class_info = context_->classes().Get( - resolved_inst.As().class_id); + resolved_inst.As().class_id); if (class_info.is_defined()) { name_context.state = NameContext::State::Resolved; name_context.target_scope_id = class_info.scope_id; @@ -160,8 +155,8 @@ auto DeclarationNameStack::UpdateScopeIfNeeded(NameContext& name_context) } } -auto DeclarationNameStack::CanResolveQualifier(NameContext& name_context, - Parse::Node parse_node) -> bool { +auto DeclNameStack::CanResolveQualifier(NameContext& name_context, + Parse::Node parse_node) -> bool { switch (name_context.state) { case NameContext::State::Error: // Already in an error state, so return without examining. @@ -180,12 +175,12 @@ auto DeclarationNameStack::CanResolveQualifier(NameContext& name_context, // qualifier didn't resolve to a scoped entity. if (auto class_decl = context_->insts() .Get(name_context.resolved_inst_id) - .TryAs()) { - CARBON_DIAGNOSTIC(QualifiedDeclarationInIncompleteClassScope, Error, + .TryAs()) { + CARBON_DIAGNOSTIC(QualifiedDeclInIncompleteClassScope, Error, "Cannot declare a member of incomplete class `{0}`.", std::string); auto builder = context_->emitter().Build( - name_context.parse_node, QualifiedDeclarationInIncompleteClassScope, + name_context.parse_node, QualifiedDeclInIncompleteClassScope, context_->sem_ir().StringifyType( context_->classes().Get(class_decl->class_id).self_type_id, true)); @@ -193,14 +188,14 @@ auto DeclarationNameStack::CanResolveQualifier(NameContext& name_context, builder.Emit(); } else { CARBON_DIAGNOSTIC( - QualifiedDeclarationInNonScope, Error, + QualifiedDeclInNonScope, Error, "Declaration qualifiers are only allowed for entities " "that provide a scope."); - CARBON_DIAGNOSTIC(QualifiedDeclarationNonScopeEntity, Note, + CARBON_DIAGNOSTIC(QualifiedDeclNonScopeEntity, Note, "Non-scope entity referenced here."); context_->emitter() - .Build(parse_node, QualifiedDeclarationInNonScope) - .Note(name_context.parse_node, QualifiedDeclarationNonScopeEntity) + .Build(parse_node, QualifiedDeclInNonScope) + .Note(name_context.parse_node, QualifiedDeclNonScopeEntity) .Emit(); } name_context.state = NameContext::State::Error; diff --git a/toolchain/check/declaration_name_stack.h b/toolchain/check/declaration_name_stack.h index ea803bb668be..7b15130ae57a 100644 --- a/toolchain/check/declaration_name_stack.h +++ b/toolchain/check/declaration_name_stack.h @@ -74,7 +74,7 @@ class Context; // // is forward declared in `MyType`, but is not a scope itself. // fn MyNamespace.MyType.DoSomething() { ... } // ``` -class DeclarationNameStack { +class DeclNameStack { public: // Context for declaration name construction. struct NameContext { @@ -128,7 +128,7 @@ class DeclarationNameStack { }; }; - explicit DeclarationNameStack(Context* context) : context_(context) {} + explicit DeclNameStack(Context* context) : context_(context) {} // Pushes processing of a new declaration name, which will be used // contextually, and prepares to enter scopes for that name. To pop this @@ -193,7 +193,7 @@ class DeclarationNameStack { Context* context_; // Provides nesting for construction. - llvm::SmallVector declaration_name_stack_; + llvm::SmallVector decl_name_stack_; }; } // namespace Carbon::Check diff --git a/toolchain/check/handle_call_expression.cpp b/toolchain/check/handle_call_expression.cpp index 4235c6e69ab6..b1a0fe728f49 100644 --- a/toolchain/check/handle_call_expression.cpp +++ b/toolchain/check/handle_call_expression.cpp @@ -48,7 +48,7 @@ auto HandleCallExpr(Context& context, Parse::Node parse_node) -> bool { return diagnose_not_callable(); } auto function_decl = - context.insts().Get(function_decl_id).TryAs(); + context.insts().Get(function_decl_id).TryAs(); if (!function_decl) { return diagnose_not_callable(); } diff --git a/toolchain/check/handle_class.cpp b/toolchain/check/handle_class.cpp index c17fdbbf289f..a4085d39374c 100644 --- a/toolchain/check/handle_class.cpp +++ b/toolchain/check/handle_class.cpp @@ -14,29 +14,29 @@ auto HandleClassIntroducer(Context& context, Parse::Node parse_node) -> bool { // Push the bracketing node. context.node_stack().Push(parse_node); // A name should always follow. - context.declaration_name_stack().PushScopeAndStartName(); + context.decl_name_stack().PushScopeAndStartName(); return true; } -static auto BuildClassDeclaration(Context& context) +static auto BuildClassDecl(Context& context) -> std::tuple { - auto name_context = context.declaration_name_stack().FinishName(); + auto name_context = context.decl_name_stack().FinishName(); auto class_keyword = context.node_stack() .PopForSoloParseNode(); auto decl_block_id = context.inst_block_stack().Pop(); // Add the class declaration. - auto class_decl = SemIR::ClassDeclaration{ - class_keyword, SemIR::ClassId::Invalid, decl_block_id}; + auto class_decl = + SemIR::ClassDecl{class_keyword, SemIR::ClassId::Invalid, decl_block_id}; auto class_decl_id = context.AddInst(class_decl); // Check whether this is a redeclaration. - auto existing_id = context.declaration_name_stack().LookupOrAddName( - name_context, class_decl_id); + auto existing_id = + context.decl_name_stack().LookupOrAddName(name_context, class_decl_id); if (existing_id.is_valid()) { if (auto existing_class_decl = - context.insts().Get(existing_id).TryAs()) { + context.insts().Get(existing_id).TryAs()) { // This is a redeclaration of an existing class. class_decl.class_id = existing_class_decl->class_id; } else { @@ -51,13 +51,13 @@ static auto BuildClassDeclaration(Context& context) // was an error in the qualifier, we will have lost track of the class name // here. We should keep track of it even if the name is invalid. class_decl.class_id = context.classes().Add( - {.name_id = name_context.state == - DeclarationNameStack::NameContext::State::Unresolved - ? name_context.unresolved_name_id - : SemIR::NameId::Invalid, + {.name_id = + name_context.state == DeclNameStack::NameContext::State::Unresolved + ? name_context.unresolved_name_id + : SemIR::NameId::Invalid, // `.self_type_id` depends on `class_id`, so is set below. .self_type_id = SemIR::TypeId::Invalid, - .declaration_id = class_decl_id}); + .decl_id = class_decl_id}); // Build the `Self` type. auto& class_info = context.classes().Get(class_decl.class_id); @@ -67,22 +67,21 @@ static auto BuildClassDeclaration(Context& context) class_decl.class_id})); } - // Write the class ID into the ClassDeclaration. + // Write the class ID into the ClassDecl. context.insts().Set(class_decl_id, class_decl); return {class_decl.class_id, class_decl_id}; } -auto HandleClassDeclaration(Context& context, Parse::Node /*parse_node*/) - -> bool { - BuildClassDeclaration(context); - context.declaration_name_stack().PopScope(); +auto HandleClassDecl(Context& context, Parse::Node /*parse_node*/) -> bool { + BuildClassDecl(context); + context.decl_name_stack().PopScope(); return true; } auto HandleClassDefinitionStart(Context& context, Parse::Node parse_node) -> bool { - auto [class_id, class_decl_id] = BuildClassDeclaration(context); + auto [class_id, class_decl_id] = BuildClassDecl(context); auto& class_info = context.classes().Get(class_id); // Track that this declaration is the definition. @@ -133,7 +132,7 @@ auto HandleClassDefinition(Context& context, Parse::Node parse_node) -> bool { context.node_stack().Pop(); context.inst_block_stack().Pop(); context.PopScope(); - context.declaration_name_stack().PopScope(); + context.decl_name_stack().PopScope(); // The class type is now fully defined. auto& class_info = context.classes().Get(class_id); diff --git a/toolchain/check/handle_function.cpp b/toolchain/check/handle_function.cpp index debab4d3b502..858d0c694810 100644 --- a/toolchain/check/handle_function.cpp +++ b/toolchain/check/handle_function.cpp @@ -8,10 +8,10 @@ namespace Carbon::Check { -// Build a FunctionDeclaration describing the signature of a function. This +// Build a FunctionDecl describing the signature of a function. This // handles the common logic shared by function declaration syntax and function // definition syntax. -static auto BuildFunctionDeclaration(Context& context, bool is_definition) +static auto BuildFunctionDecl(Context& context, bool is_definition) -> std::pair { // TODO: This contains the IR block for the parameters and return type. At // present, it's just loose, but it's not strictly required for parameter @@ -55,25 +55,23 @@ static auto BuildFunctionDeclaration(Context& context, bool is_definition) context.node_stack() .PopIf() .value_or(SemIR::InstBlockId::Empty); - auto name_context = context.declaration_name_stack().FinishName(); + auto name_context = context.decl_name_stack().FinishName(); auto fn_node = context.node_stack() .PopForSoloParseNode(); // Add the function declaration. - auto function_decl = SemIR::FunctionDeclaration{ + auto function_decl = SemIR::FunctionDecl{ fn_node, context.GetBuiltinType(SemIR::BuiltinKind::FunctionType), SemIR::FunctionId::Invalid}; auto function_decl_id = context.AddInst(function_decl); // Check whether this is a redeclaration. - auto existing_id = context.declaration_name_stack().LookupOrAddName( - name_context, function_decl_id); + auto existing_id = + context.decl_name_stack().LookupOrAddName(name_context, function_decl_id); if (existing_id.is_valid()) { if (auto existing_function_decl = - context.insts() - .Get(existing_id) - .TryAs()) { + context.insts().Get(existing_id).TryAs()) { // This is a redeclaration of an existing function. function_decl.function_id = existing_function_decl->function_id; @@ -98,17 +96,17 @@ static auto BuildFunctionDeclaration(Context& context, bool is_definition) // Create a new function if this isn't a valid redeclaration. if (!function_decl.function_id.is_valid()) { function_decl.function_id = context.functions().Add( - {.name_id = name_context.state == - DeclarationNameStack::NameContext::State::Unresolved - ? name_context.unresolved_name_id - : SemIR::NameId::Invalid, + {.name_id = + name_context.state == DeclNameStack::NameContext::State::Unresolved + ? name_context.unresolved_name_id + : SemIR::NameId::Invalid, .implicit_param_refs_id = implicit_param_refs_id, .param_refs_id = param_refs_id, .return_type_id = return_type_id, .return_slot_id = return_slot_id}); } - // Write the function ID into the FunctionDeclaration. + // Write the function ID into the FunctionDecl. context.insts().Set(function_decl_id, function_decl); if (SemIR::IsEntryPoint(context.sem_ir(), function_decl.function_id)) { @@ -129,10 +127,9 @@ static auto BuildFunctionDeclaration(Context& context, bool is_definition) return {function_decl.function_id, function_decl_id}; } -auto HandleFunctionDeclaration(Context& context, Parse::Node /*parse_node*/) - -> bool { - BuildFunctionDeclaration(context, /*is_definition=*/false); - context.declaration_name_stack().PopScope(); +auto HandleFunctionDecl(Context& context, Parse::Node /*parse_node*/) -> bool { + BuildFunctionDecl(context, /*is_definition=*/false); + context.decl_name_stack().PopScope(); return true; } @@ -157,7 +154,7 @@ auto HandleFunctionDefinition(Context& context, Parse::Node parse_node) context.PopScope(); context.inst_block_stack().Pop(); context.return_scope_stack().pop_back(); - context.declaration_name_stack().PopScope(); + context.decl_name_stack().PopScope(); return true; } @@ -165,7 +162,7 @@ auto HandleFunctionDefinitionStart(Context& context, Parse::Node parse_node) -> bool { // Process the declaration portion of the function. auto [function_id, decl_id] = - BuildFunctionDeclaration(context, /*is_definition=*/true); + BuildFunctionDecl(context, /*is_definition=*/true); auto& function = context.functions().Get(function_id); // Track that this declaration is the definition. @@ -231,7 +228,7 @@ auto HandleFunctionIntroducer(Context& context, Parse::Node parse_node) // Push the bracketing node. context.node_stack().Push(parse_node); // A name should always follow. - context.declaration_name_stack().PushScopeAndStartName(); + context.decl_name_stack().PushScopeAndStartName(); return true; } diff --git a/toolchain/check/handle_interface.cpp b/toolchain/check/handle_interface.cpp index 84c9f9a95572..edb4615430f7 100644 --- a/toolchain/check/handle_interface.cpp +++ b/toolchain/check/handle_interface.cpp @@ -6,9 +6,8 @@ namespace Carbon::Check { -auto HandleInterfaceDeclaration(Context& context, Parse::Node parse_node) - -> bool { - return context.TODO(parse_node, "HandleInterfaceDeclaration"); +auto HandleInterfaceDecl(Context& context, Parse::Node parse_node) -> bool { + return context.TODO(parse_node, "HandleInterfaceDecl"); } auto HandleInterfaceDefinition(Context& context, Parse::Node parse_node) diff --git a/toolchain/check/handle_let.cpp b/toolchain/check/handle_let.cpp index 9de78538234d..1c8fd6d26c29 100644 --- a/toolchain/check/handle_let.cpp +++ b/toolchain/check/handle_let.cpp @@ -8,7 +8,7 @@ namespace Carbon::Check { -auto HandleLetDeclaration(Context& context, Parse::Node parse_node) -> bool { +auto HandleLetDecl(Context& context, Parse::Node parse_node) -> bool { auto value_id = context.node_stack().PopExpr(); SemIR::InstId pattern_id = context.node_stack().Pop(); diff --git a/toolchain/check/handle_name.cpp b/toolchain/check/handle_name.cpp index 3c53c7ff4cf8..69aa232cf7c1 100644 --- a/toolchain/check/handle_name.cpp +++ b/toolchain/check/handle_name.cpp @@ -43,7 +43,7 @@ static auto GetExprValueForLookupResult(Context& context, -> SemIR::InstId { // If lookup finds a class declaration, the value is its `Self` type. auto lookup_result = context.insts().Get(lookup_result_id); - if (auto class_decl = lookup_result.TryAs()) { + if (auto class_decl = lookup_result.TryAs()) { return context.sem_ir().GetTypeAllowBuiltinTypes( context.classes().Get(class_decl->class_id).self_type_id); } @@ -148,9 +148,8 @@ auto HandleMemberAccessExpr(Context& context, Parse::Node parse_node) -> bool { CARBON_CHECK(function_name_id.is_valid()) << "Non-constant value " << context.insts().Get(member_id) << " of function type"; - auto function_decl = context.insts() - .Get(function_name_id) - .TryAs(); + auto function_decl = + context.insts().Get(function_name_id).TryAs(); CARBON_CHECK(function_decl) << "Unexpected value " << context.insts().Get(function_name_id) << " of function type"; @@ -242,25 +241,24 @@ auto HandleNameExpr(Context& context, Parse::Node parse_node) -> bool { return true; } -auto HandleQualifiedDeclaration(Context& context, Parse::Node parse_node) - -> bool { +auto HandleQualifiedDecl(Context& context, Parse::Node parse_node) -> bool { auto [parse_node2, name_id2] = context.node_stack().PopWithParseNode(); Parse::Node parse_node1 = context.node_stack().PeekParseNode(); switch (context.parse_tree().node_kind(parse_node1)) { - case Parse::NodeKind::QualifiedDeclaration: - // This is the second or subsequent QualifiedDeclaration in a chain. - // Nothing to do: the first QualifiedDeclaration remains as a - // bracketing node for later QualifiedDeclarations. + case Parse::NodeKind::QualifiedDecl: + // This is the second or subsequent QualifiedDecl in a chain. + // Nothing to do: the first QualifiedDecl remains as a + // bracketing node for later QualifiedDecls. break; case Parse::NodeKind::Name: { - // This is the first QualifiedDeclaration in a chain, and starts with a + // This is the first QualifiedDecl in a chain, and starts with a // name. auto name_id = context.node_stack().Pop(); - context.declaration_name_stack().ApplyNameQualifier(parse_node1, name_id); - // Add the QualifiedDeclaration so that it can be used for bracketing. + context.decl_name_stack().ApplyNameQualifier(parse_node1, name_id); + // Add the QualifiedDecl so that it can be used for bracketing. context.node_stack().Push(parse_node); break; } @@ -270,7 +268,7 @@ auto HandleQualifiedDeclaration(Context& context, Parse::Node parse_node) "declaration name"; } - context.declaration_name_stack().ApplyNameQualifier(parse_node2, name_id2); + context.decl_name_stack().ApplyNameQualifier(parse_node2, name_id2); return true; } diff --git a/toolchain/check/handle_named_constraint.cpp b/toolchain/check/handle_named_constraint.cpp index 9dd2da71256d..02ff814ddaac 100644 --- a/toolchain/check/handle_named_constraint.cpp +++ b/toolchain/check/handle_named_constraint.cpp @@ -6,9 +6,9 @@ namespace Carbon::Check { -auto HandleNamedConstraintDeclaration(Context& context, Parse::Node parse_node) +auto HandleNamedConstraintDecl(Context& context, Parse::Node parse_node) -> bool { - return context.TODO(parse_node, "HandleNamedConstraintDeclaration"); + return context.TODO(parse_node, "HandleNamedConstraintDecl"); } auto HandleNamedConstraintDefinition(Context& context, Parse::Node parse_node) diff --git a/toolchain/check/handle_namespace.cpp b/toolchain/check/handle_namespace.cpp index 87df48c6bfd9..9dbec400361d 100644 --- a/toolchain/check/handle_namespace.cpp +++ b/toolchain/check/handle_namespace.cpp @@ -9,17 +9,17 @@ namespace Carbon::Check { auto HandleNamespaceStart(Context& context, Parse::Node /*parse_node*/) -> bool { - context.declaration_name_stack().PushScopeAndStartName(); + context.decl_name_stack().PushScopeAndStartName(); return true; } auto HandleNamespace(Context& context, Parse::Node parse_node) -> bool { - auto name_context = context.declaration_name_stack().FinishName(); + auto name_context = context.decl_name_stack().FinishName(); auto namespace_id = context.AddInst(SemIR::Namespace{ parse_node, context.GetBuiltinType(SemIR::BuiltinKind::NamespaceType), context.name_scopes().Add()}); - context.declaration_name_stack().AddNameToLookup(name_context, namespace_id); - context.declaration_name_stack().PopScope(); + context.decl_name_stack().AddNameToLookup(name_context, namespace_id); + context.decl_name_stack().PopScope(); return true; } diff --git a/toolchain/check/handle_noop.cpp b/toolchain/check/handle_noop.cpp index d7a2ea7f80e8..96ac4dfe00f8 100644 --- a/toolchain/check/handle_noop.cpp +++ b/toolchain/check/handle_noop.cpp @@ -6,8 +6,7 @@ namespace Carbon::Check { -auto HandleEmptyDeclaration(Context& /*context*/, Parse::Node /*parse_node*/) - -> bool { +auto HandleEmptyDecl(Context& /*context*/, Parse::Node /*parse_node*/) -> bool { // Empty declarations have no actions associated. return true; } diff --git a/toolchain/check/handle_pattern_binding.cpp b/toolchain/check/handle_pattern_binding.cpp index 93ccf37cd622..ba4cfd9bc3e1 100644 --- a/toolchain/check/handle_pattern_binding.cpp +++ b/toolchain/check/handle_pattern_binding.cpp @@ -64,14 +64,13 @@ auto HandlePatternBinding(Context& context, Parse::Node parse_node) -> bool { context.node_stack().PeekParseNode())) { case Parse::NodeKind::VariableIntroducer: { // A `var` declaration at class scope introduces a field. - auto enclosing_class_decl = - context.GetCurrentScopeAs(); + auto enclosing_class_decl = context.GetCurrentScopeAs(); if (!context.TryToCompleteType(cast_type_id, [&] { - CARBON_DIAGNOSTIC(IncompleteTypeInVarDeclaration, Error, + CARBON_DIAGNOSTIC(IncompleteTypeInVarDecl, Error, "{0} has incomplete type `{1}`.", llvm::StringRef, std::string); return context.emitter().Build( - type_node_copy, IncompleteTypeInVarDeclaration, + type_node_copy, IncompleteTypeInVarDecl, enclosing_class_decl ? "Field" : "Variable", context.sem_ir().StringifyType(cast_type_id, true)); })) { @@ -116,11 +115,11 @@ auto HandlePatternBinding(Context& context, Parse::Node parse_node) -> bool { case Parse::NodeKind::LetIntroducer: if (!context.TryToCompleteType(cast_type_id, [&] { - CARBON_DIAGNOSTIC(IncompleteTypeInLetDeclaration, Error, + CARBON_DIAGNOSTIC(IncompleteTypeInLetDecl, Error, "`let` binding has incomplete type `{0}`.", std::string); return context.emitter().Build( - type_node_copy, IncompleteTypeInLetDeclaration, + type_node_copy, IncompleteTypeInLetDecl, context.sem_ir().StringifyType(cast_type_id, true)); })) { cast_type_id = SemIR::TypeId::Error; diff --git a/toolchain/check/handle_statement.cpp b/toolchain/check/handle_statement.cpp index 19ba73b0ed48..f76e7a4300f4 100644 --- a/toolchain/check/handle_statement.cpp +++ b/toolchain/check/handle_statement.cpp @@ -28,7 +28,7 @@ auto HandleExprStatement(Context& context, Parse::Node /*parse_node*/) -> bool { auto HandleReturnStatement(Context& context, Parse::Node parse_node) -> bool { CARBON_CHECK(!context.return_scope_stack().empty()); - auto fn_inst = context.insts().GetAs( + auto fn_inst = context.insts().GetAs( context.return_scope_stack().back()); const auto& callable = context.functions().Get(fn_inst.function_id); diff --git a/toolchain/check/handle_variable.cpp b/toolchain/check/handle_variable.cpp index 4311cdaf2627..437f48b2b1b8 100644 --- a/toolchain/check/handle_variable.cpp +++ b/toolchain/check/handle_variable.cpp @@ -8,8 +8,7 @@ namespace Carbon::Check { -auto HandleVariableDeclaration(Context& context, Parse::Node parse_node) - -> bool { +auto HandleVariableDecl(Context& context, Parse::Node parse_node) -> bool { // Handle the optional initializer. auto init_id = SemIR::InstId::Invalid; bool has_init = @@ -26,9 +25,9 @@ auto HandleVariableDeclaration(Context& context, Parse::Node parse_node) if (auto bind_name = context.insts().Get(value_id).TryAs()) { // Form a corresponding name in the current context, and bind the name to // the variable. - context.declaration_name_stack().AddNameToLookup( - context.declaration_name_stack().MakeUnqualifiedName( - bind_name->parse_node, bind_name->name_id), + context.decl_name_stack().AddNameToLookup( + context.decl_name_stack().MakeUnqualifiedName(bind_name->parse_node, + bind_name->name_id), value_id); value_id = bind_name->value_id; } diff --git a/toolchain/check/node_stack.h b/toolchain/check/node_stack.h index 036d93cc4cbe..fece0099c822 100644 --- a/toolchain/check/node_stack.h +++ b/toolchain/check/node_stack.h @@ -326,7 +326,7 @@ class NodeStack { case Parse::NodeKind::LetIntroducer: case Parse::NodeKind::ParameterListStart: case Parse::NodeKind::ParenExprOrTupleLiteralStart: - case Parse::NodeKind::QualifiedDeclaration: + case Parse::NodeKind::QualifiedDecl: case Parse::NodeKind::ReturnStatementStart: case Parse::NodeKind::SelfValueName: case Parse::NodeKind::StructLiteralOrStructTypeLiteralStart: diff --git a/toolchain/check/testdata/array/fail_incomplete_element.carbon b/toolchain/check/testdata/array/fail_incomplete_element.carbon index a2a4b9bc056e..1852cb18e881 100644 --- a/toolchain/check/testdata/array/fail_incomplete_element.carbon +++ b/toolchain/check/testdata/array/fail_incomplete_element.carbon @@ -24,7 +24,7 @@ var p: Incomplete* = &a[0]; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "fail_incomplete_element.carbon" { -// CHECK:STDOUT: class_declaration @Incomplete, () +// CHECK:STDOUT: class_decl @Incomplete, () // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete // CHECK:STDOUT: %Incomplete.ref.loc15: type = name_reference Incomplete, %Incomplete // CHECK:STDOUT: %.loc15_21: i32 = int_literal 1 diff --git a/toolchain/check/testdata/as/identity.carbon b/toolchain/check/testdata/as/identity.carbon index c5e2c268bd52..38aa8c28543f 100644 --- a/toolchain/check/testdata/as/identity.carbon +++ b/toolchain/check/testdata/as/identity.carbon @@ -31,7 +31,7 @@ fn Initializing() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "identity.carbon" { -// CHECK:STDOUT: class_declaration @X, () +// CHECK:STDOUT: class_decl @X, () // CHECK:STDOUT: %X: type = class_type @X // CHECK:STDOUT: %Value: = fn_decl @Value // CHECK:STDOUT: %Reference: = fn_decl @Reference diff --git a/toolchain/check/testdata/as/tuple.carbon b/toolchain/check/testdata/as/tuple.carbon index 28c9ec039ba1..e6b0188dc4be 100644 --- a/toolchain/check/testdata/as/tuple.carbon +++ b/toolchain/check/testdata/as/tuple.carbon @@ -31,7 +31,7 @@ fn Var() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "tuple.carbon" { -// CHECK:STDOUT: class_declaration @X, () +// CHECK:STDOUT: class_decl @X, () // CHECK:STDOUT: %X: type = class_type @X // CHECK:STDOUT: %Make: = fn_decl @Make // CHECK:STDOUT: %Let: = fn_decl @Let diff --git a/toolchain/check/testdata/basics/multifile_raw_and_textual_ir.carbon b/toolchain/check/testdata/basics/multifile_raw_and_textual_ir.carbon index 94da86a57bd3..159dc3c22674 100644 --- a/toolchain/check/testdata/basics/multifile_raw_and_textual_ir.carbon +++ b/toolchain/check/testdata/basics/multifile_raw_and_textual_ir.carbon @@ -25,7 +25,7 @@ fn B() {} // CHECK:STDOUT: type0: {inst: instFunctionType, value_rep: {kind: copy, type: type0}} // CHECK:STDOUT: type_blocks: {} // CHECK:STDOUT: insts: -// CHECK:STDOUT: inst+0: {kind: FunctionDeclaration, arg0: function0, type: type0} +// CHECK:STDOUT: inst+0: {kind: FunctionDecl, arg0: function0, type: type0} // CHECK:STDOUT: inst+1: {kind: Return} // CHECK:STDOUT: inst_blocks: // CHECK:STDOUT: block0: {} @@ -54,7 +54,7 @@ fn B() {} // CHECK:STDOUT: type0: {inst: instFunctionType, value_rep: {kind: copy, type: type0}} // CHECK:STDOUT: type_blocks: {} // CHECK:STDOUT: insts: -// CHECK:STDOUT: inst+0: {kind: FunctionDeclaration, arg0: function0, type: type0} +// CHECK:STDOUT: inst+0: {kind: FunctionDecl, arg0: function0, type: type0} // CHECK:STDOUT: inst+1: {kind: Return} // CHECK:STDOUT: inst_blocks: // CHECK:STDOUT: block0: {} diff --git a/toolchain/check/testdata/basics/multifile_raw_ir.carbon b/toolchain/check/testdata/basics/multifile_raw_ir.carbon index 7c8b34960146..f87a00c1abe1 100644 --- a/toolchain/check/testdata/basics/multifile_raw_ir.carbon +++ b/toolchain/check/testdata/basics/multifile_raw_ir.carbon @@ -25,7 +25,7 @@ fn B() {} // CHECK:STDOUT: type0: {inst: instFunctionType, value_rep: {kind: copy, type: type0}} // CHECK:STDOUT: type_blocks: {} // CHECK:STDOUT: insts: -// CHECK:STDOUT: inst+0: {kind: FunctionDeclaration, arg0: function0, type: type0} +// CHECK:STDOUT: inst+0: {kind: FunctionDecl, arg0: function0, type: type0} // CHECK:STDOUT: inst+1: {kind: Return} // CHECK:STDOUT: inst_blocks: // CHECK:STDOUT: block0: {} @@ -45,7 +45,7 @@ fn B() {} // CHECK:STDOUT: type0: {inst: instFunctionType, value_rep: {kind: copy, type: type0}} // CHECK:STDOUT: type_blocks: {} // CHECK:STDOUT: insts: -// CHECK:STDOUT: inst+0: {kind: FunctionDeclaration, arg0: function0, type: type0} +// CHECK:STDOUT: inst+0: {kind: FunctionDecl, arg0: function0, type: type0} // CHECK:STDOUT: inst+1: {kind: Return} // CHECK:STDOUT: inst_blocks: // CHECK:STDOUT: block0: {} diff --git a/toolchain/check/testdata/basics/raw_and_textual_ir.carbon b/toolchain/check/testdata/basics/raw_and_textual_ir.carbon index e54e59fc9e40..895a1224f489 100644 --- a/toolchain/check/testdata/basics/raw_and_textual_ir.carbon +++ b/toolchain/check/testdata/basics/raw_and_textual_ir.carbon @@ -41,7 +41,7 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: inst+4: {kind: Converted, arg0: inst+2, arg1: inst+3, type: typeTypeType} // CHECK:STDOUT: inst+5: {kind: VarStorage, arg0: nameReturnSlot, type: type3} // CHECK:STDOUT: inst+6: {kind: PointerType, arg0: type3, type: typeTypeType} -// CHECK:STDOUT: inst+7: {kind: FunctionDeclaration, arg0: function0, type: type5} +// CHECK:STDOUT: inst+7: {kind: FunctionDecl, arg0: function0, type: type5} // CHECK:STDOUT: inst+8: {kind: NameReference, arg0: name1, arg1: inst+0, type: type0} // CHECK:STDOUT: inst+9: {kind: IntegerLiteral, arg0: int3, type: type0} // CHECK:STDOUT: inst+10: {kind: BinaryOperatorAdd, arg0: inst+8, arg1: inst+9, type: type0} diff --git a/toolchain/check/testdata/basics/raw_ir.carbon b/toolchain/check/testdata/basics/raw_ir.carbon index 92a854ab8557..84627425b83b 100644 --- a/toolchain/check/testdata/basics/raw_ir.carbon +++ b/toolchain/check/testdata/basics/raw_ir.carbon @@ -41,7 +41,7 @@ fn Foo(n: i32) -> (i32, f64) { // CHECK:STDOUT: inst+4: {kind: Converted, arg0: inst+2, arg1: inst+3, type: typeTypeType} // CHECK:STDOUT: inst+5: {kind: VarStorage, arg0: nameReturnSlot, type: type3} // CHECK:STDOUT: inst+6: {kind: PointerType, arg0: type3, type: typeTypeType} -// CHECK:STDOUT: inst+7: {kind: FunctionDeclaration, arg0: function0, type: type5} +// CHECK:STDOUT: inst+7: {kind: FunctionDecl, arg0: function0, type: type5} // CHECK:STDOUT: inst+8: {kind: NameReference, arg0: name1, arg1: inst+0, type: type0} // CHECK:STDOUT: inst+9: {kind: IntegerLiteral, arg0: int3, type: type0} // CHECK:STDOUT: inst+10: {kind: BinaryOperatorAdd, arg0: inst+8, arg1: inst+9, type: type0} diff --git a/toolchain/check/testdata/basics/verbose.carbon b/toolchain/check/testdata/basics/verbose.carbon index 8eca8e6c7f0c..4cedbbf01fd1 100644 --- a/toolchain/check/testdata/basics/verbose.carbon +++ b/toolchain/check/testdata/basics/verbose.carbon @@ -8,7 +8,7 @@ // NOAUTOUPDATE // SET-CHECK-SUBSET // CHECK:STDERR: Node Push 0: FunctionIntroducer -> -// CHECK:STDERR: AddInst: {kind: FunctionDeclaration, arg0: {{.*}}, type: type{{[0-9]+}}} +// CHECK:STDERR: AddInst: {kind: FunctionDecl, arg0: {{.*}}, type: type{{[0-9]+}}} // CHECK:STDERR: inst_block_stack_ Push 1 // CHECK:STDERR: AddInst: {kind: Return} // CHECK:STDERR: inst_block_stack_ Pop 1: block{{[0-9]+}} diff --git a/toolchain/check/testdata/class/basic.carbon b/toolchain/check/testdata/class/basic.carbon index 9748cc840525..779866f82f16 100644 --- a/toolchain/check/testdata/class/basic.carbon +++ b/toolchain/check/testdata/class/basic.carbon @@ -27,7 +27,7 @@ fn Run() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "basic.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class // CHECK:STDOUT: %G: = fn_decl @G // CHECK:STDOUT: %Run: = fn_decl @Run diff --git a/toolchain/check/testdata/class/fail_addr_not_self.carbon b/toolchain/check/testdata/class/fail_addr_not_self.carbon index 8794417fdfcb..533985a37d45 100644 --- a/toolchain/check/testdata/class/fail_addr_not_self.carbon +++ b/toolchain/check/testdata/class/fail_addr_not_self.carbon @@ -21,7 +21,7 @@ class Class { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "fail_addr_not_self.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_addr_self.carbon b/toolchain/check/testdata/class/fail_addr_self.carbon index a46f986cbb2b..c9a7b2df6a44 100644 --- a/toolchain/check/testdata/class/fail_addr_self.carbon +++ b/toolchain/check/testdata/class/fail_addr_self.carbon @@ -45,7 +45,7 @@ fn F(c: Class, p: Class*) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "fail_addr_self.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class // CHECK:STDOUT: %F: = fn_decl @F.2 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_incomplete.carbon b/toolchain/check/testdata/class/fail_incomplete.carbon index ec5984ffcd93..fa1943ee42e1 100644 --- a/toolchain/check/testdata/class/fail_incomplete.carbon +++ b/toolchain/check/testdata/class/fail_incomplete.carbon @@ -121,7 +121,7 @@ fn CallReturnIncomplete() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "fail_incomplete.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class // CHECK:STDOUT: %.loc15: = fn_decl @.1 // CHECK:STDOUT: %CallClassFunction: = fn_decl @CallClassFunction diff --git a/toolchain/check/testdata/class/fail_init.carbon b/toolchain/check/testdata/class/fail_init.carbon index 40ce6d2e298a..f2b89f185c50 100644 --- a/toolchain/check/testdata/class/fail_init.carbon +++ b/toolchain/check/testdata/class/fail_init.carbon @@ -33,7 +33,7 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "fail_init.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class // CHECK:STDOUT: %F: = fn_decl @F // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_init_as_inplace.carbon b/toolchain/check/testdata/class/fail_init_as_inplace.carbon index 6b7908c6e089..1761ed7d5742 100644 --- a/toolchain/check/testdata/class/fail_init_as_inplace.carbon +++ b/toolchain/check/testdata/class/fail_init_as_inplace.carbon @@ -29,7 +29,7 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "fail_init_as_inplace.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class // CHECK:STDOUT: %G: = fn_decl @G // CHECK:STDOUT: %F: = fn_decl @F diff --git a/toolchain/check/testdata/class/fail_memaccess_category.carbon b/toolchain/check/testdata/class/fail_memaccess_category.carbon index b2b21555e7bb..2199ffea2d26 100644 --- a/toolchain/check/testdata/class/fail_memaccess_category.carbon +++ b/toolchain/check/testdata/class/fail_memaccess_category.carbon @@ -43,9 +43,9 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "fail_memaccess_category.carbon" { -// CHECK:STDOUT: class_declaration @A, () +// CHECK:STDOUT: class_decl @A, () // CHECK:STDOUT: %A: type = class_type @A -// CHECK:STDOUT: class_declaration @B, () +// CHECK:STDOUT: class_decl @B, () // CHECK:STDOUT: %B: type = class_type @B // CHECK:STDOUT: %F: = fn_decl @F.2 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_member_of_let.carbon b/toolchain/check/testdata/class/fail_member_of_let.carbon index d86e7ffce9b3..03b57f2e39ab 100644 --- a/toolchain/check/testdata/class/fail_member_of_let.carbon +++ b/toolchain/check/testdata/class/fail_member_of_let.carbon @@ -26,7 +26,7 @@ fn T.F() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "fail_member_of_let.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class // CHECK:STDOUT: %Class.ref: type = name_reference Class, %Class // CHECK:STDOUT: %T: type = bind_name T, %Class.ref diff --git a/toolchain/check/testdata/class/fail_method.carbon b/toolchain/check/testdata/class/fail_method.carbon index a80b8e77ca26..2e52733d2caf 100644 --- a/toolchain/check/testdata/class/fail_method.carbon +++ b/toolchain/check/testdata/class/fail_method.carbon @@ -37,7 +37,7 @@ fn F(c: Class) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "fail_method.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class // CHECK:STDOUT: %F: = fn_decl @F // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_redeclaration_scope.carbon b/toolchain/check/testdata/class/fail_redeclaration_scope.carbon index a668aced9713..7797c6b3ce4d 100644 --- a/toolchain/check/testdata/class/fail_redeclaration_scope.carbon +++ b/toolchain/check/testdata/class/fail_redeclaration_scope.carbon @@ -26,17 +26,17 @@ class Y { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "fail_redeclaration_scope.carbon" { -// CHECK:STDOUT: class_declaration @A.1, () +// CHECK:STDOUT: class_decl @A.1, () // CHECK:STDOUT: %A: type = class_type @A.1 -// CHECK:STDOUT: class_declaration @X, () +// CHECK:STDOUT: class_decl @X, () // CHECK:STDOUT: %X: type = class_type @X -// CHECK:STDOUT: class_declaration @A.1, () -// CHECK:STDOUT: class_declaration @Y, () +// CHECK:STDOUT: class_decl @A.1, () +// CHECK:STDOUT: class_decl @Y, () // CHECK:STDOUT: %Y: type = class_type @Y // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A.1 { -// CHECK:STDOUT: class_declaration @B.2, () +// CHECK:STDOUT: class_decl @B.2, () // CHECK:STDOUT: %B: type = class_type @B.2 // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -44,16 +44,16 @@ class Y { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @X { -// CHECK:STDOUT: class_declaration @A.2, () +// CHECK:STDOUT: class_decl @A.2, () // CHECK:STDOUT: %A: type = class_type @A.2 -// CHECK:STDOUT: class_declaration @B.1, () +// CHECK:STDOUT: class_decl @B.1, () // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .A = // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @A.2 { -// CHECK:STDOUT: class_declaration @B.1, () +// CHECK:STDOUT: class_decl @B.1, () // CHECK:STDOUT: %B: type = class_type @B.1 // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -68,7 +68,7 @@ class Y { // CHECK:STDOUT: class @B.2; // CHECK:STDOUT: // CHECK:STDOUT: class @Y { -// CHECK:STDOUT: class_declaration @.1, () +// CHECK:STDOUT: class_decl @.1, () // CHECK:STDOUT: %.loc21: type = class_type @.1 // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/class/fail_redefinition.carbon b/toolchain/check/testdata/class/fail_redefinition.carbon index 1cd39adc9e6e..cd9dea83b836 100644 --- a/toolchain/check/testdata/class/fail_redefinition.carbon +++ b/toolchain/check/testdata/class/fail_redefinition.carbon @@ -29,9 +29,9 @@ fn Class.H() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "fail_redefinition.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %F: = fn_decl @F // CHECK:STDOUT: %G: = fn_decl @G // CHECK:STDOUT: %H: = fn_decl @H diff --git a/toolchain/check/testdata/class/fail_reorder.carbon b/toolchain/check/testdata/class/fail_reorder.carbon index 56007a680d70..d4203e7bd1ce 100644 --- a/toolchain/check/testdata/class/fail_reorder.carbon +++ b/toolchain/check/testdata/class/fail_reorder.carbon @@ -30,7 +30,7 @@ class Class { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "fail_reorder.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_scope.carbon b/toolchain/check/testdata/class/fail_scope.carbon index ce5a9ca183c6..e44f92212afb 100644 --- a/toolchain/check/testdata/class/fail_scope.carbon +++ b/toolchain/check/testdata/class/fail_scope.carbon @@ -22,7 +22,7 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "fail_scope.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class // CHECK:STDOUT: %G: = fn_decl @G // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_self.carbon b/toolchain/check/testdata/class/fail_self.carbon index e396e86d2649..f6b6bf218f41 100644 --- a/toolchain/check/testdata/class/fail_self.carbon +++ b/toolchain/check/testdata/class/fail_self.carbon @@ -57,11 +57,11 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "fail_self.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class // CHECK:STDOUT: %F: = fn_decl @F.1 // CHECK:STDOUT: %G: = fn_decl @G -// CHECK:STDOUT: class_declaration @WrongSelf, () +// CHECK:STDOUT: class_decl @WrongSelf, () // CHECK:STDOUT: %WrongSelf: type = class_type @WrongSelf // CHECK:STDOUT: %CallWrongSelf: = fn_decl @CallWrongSelf // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_unbound_field.carbon b/toolchain/check/testdata/class/fail_unbound_field.carbon index ced581e093fe..fe71d8fbd297 100644 --- a/toolchain/check/testdata/class/fail_unbound_field.carbon +++ b/toolchain/check/testdata/class/fail_unbound_field.carbon @@ -26,7 +26,7 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "fail_unbound_field.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class // CHECK:STDOUT: %G: = fn_decl @G // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_unknown_member.carbon b/toolchain/check/testdata/class/fail_unknown_member.carbon index 9a56239727e2..c12c0931b34e 100644 --- a/toolchain/check/testdata/class/fail_unknown_member.carbon +++ b/toolchain/check/testdata/class/fail_unknown_member.carbon @@ -22,7 +22,7 @@ fn G(c: Class) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "fail_unknown_member.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class // CHECK:STDOUT: %G: = fn_decl @G // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/field_access.carbon b/toolchain/check/testdata/class/field_access.carbon index 2043142ec31e..2860a7a7e311 100644 --- a/toolchain/check/testdata/class/field_access.carbon +++ b/toolchain/check/testdata/class/field_access.carbon @@ -22,7 +22,7 @@ fn Run() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "field_access.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class // CHECK:STDOUT: %Run: = fn_decl @Run // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/field_access_in_value.carbon b/toolchain/check/testdata/class/field_access_in_value.carbon index ba4069d11fff..d8b821971a0b 100644 --- a/toolchain/check/testdata/class/field_access_in_value.carbon +++ b/toolchain/check/testdata/class/field_access_in_value.carbon @@ -23,7 +23,7 @@ fn Run() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "field_access_in_value.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class // CHECK:STDOUT: %Run: = fn_decl @Run // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/forward_declared.carbon b/toolchain/check/testdata/class/forward_declared.carbon index 0542cc653bc5..a391ec7a4fda 100644 --- a/toolchain/check/testdata/class/forward_declared.carbon +++ b/toolchain/check/testdata/class/forward_declared.carbon @@ -9,7 +9,7 @@ class Class; fn F(p: Class*) -> Class* { return p; } // CHECK:STDOUT: file "forward_declared.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class // CHECK:STDOUT: %F: = fn_decl @F // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/init.carbon b/toolchain/check/testdata/class/init.carbon index f41e9f15107b..45e026c79ca2 100644 --- a/toolchain/check/testdata/class/init.carbon +++ b/toolchain/check/testdata/class/init.carbon @@ -24,7 +24,7 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "init.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class // CHECK:STDOUT: %Make: = fn_decl @Make // CHECK:STDOUT: %MakeReorder: = fn_decl @MakeReorder diff --git a/toolchain/check/testdata/class/init_as.carbon b/toolchain/check/testdata/class/init_as.carbon index da99b3b50c07..a2537295b9cd 100644 --- a/toolchain/check/testdata/class/init_as.carbon +++ b/toolchain/check/testdata/class/init_as.carbon @@ -19,7 +19,7 @@ fn F() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "init_as.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class // CHECK:STDOUT: %F: = fn_decl @F // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/init_nested.carbon b/toolchain/check/testdata/class/init_nested.carbon index 7908b229fc01..82625fd1adb4 100644 --- a/toolchain/check/testdata/class/init_nested.carbon +++ b/toolchain/check/testdata/class/init_nested.carbon @@ -30,10 +30,10 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "init_nested.carbon" { -// CHECK:STDOUT: class_declaration @Inner, () +// CHECK:STDOUT: class_decl @Inner, () // CHECK:STDOUT: %Inner: type = class_type @Inner // CHECK:STDOUT: %MakeInner: = fn_decl @MakeInner -// CHECK:STDOUT: class_declaration @Outer, () +// CHECK:STDOUT: class_decl @Outer, () // CHECK:STDOUT: %Outer: type = class_type @Outer // CHECK:STDOUT: %MakeOuter: = fn_decl @MakeOuter // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/method.carbon b/toolchain/check/testdata/class/method.carbon index 612d835c7612..5b83760a2a77 100644 --- a/toolchain/check/testdata/class/method.carbon +++ b/toolchain/check/testdata/class/method.carbon @@ -50,7 +50,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "method.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class // CHECK:STDOUT: %F: = fn_decl @F // CHECK:STDOUT: %Call: = fn_decl @Call diff --git a/toolchain/check/testdata/class/nested.carbon b/toolchain/check/testdata/class/nested.carbon index 598f74793371..7cf86c6f936f 100644 --- a/toolchain/check/testdata/class/nested.carbon +++ b/toolchain/check/testdata/class/nested.carbon @@ -36,13 +36,13 @@ fn F(a: Outer*) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "nested.carbon" { -// CHECK:STDOUT: class_declaration @Outer, () +// CHECK:STDOUT: class_decl @Outer, () // CHECK:STDOUT: %Outer: type = class_type @Outer // CHECK:STDOUT: %F: = fn_decl @F // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Outer { -// CHECK:STDOUT: class_declaration @Inner, () +// CHECK:STDOUT: class_decl @Inner, () // CHECK:STDOUT: %Inner: type = class_type @Inner // CHECK:STDOUT: %Self.ref: type = name_reference Self, file.%Outer // CHECK:STDOUT: %.loc14_15: type = ptr_type Outer diff --git a/toolchain/check/testdata/class/nested_name.carbon b/toolchain/check/testdata/class/nested_name.carbon index da6cb465d156..59dfc1584900 100644 --- a/toolchain/check/testdata/class/nested_name.carbon +++ b/toolchain/check/testdata/class/nested_name.carbon @@ -27,14 +27,14 @@ fn G(o: Outer) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "nested_name.carbon" { -// CHECK:STDOUT: class_declaration @Outer, () +// CHECK:STDOUT: class_decl @Outer, () // CHECK:STDOUT: %Outer: type = class_type @Outer // CHECK:STDOUT: %F: = fn_decl @F // CHECK:STDOUT: %G: = fn_decl @G // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @Outer { -// CHECK:STDOUT: class_declaration @Inner, () +// CHECK:STDOUT: class_decl @Inner, () // CHECK:STDOUT: %Inner: type = class_type @Inner // CHECK:STDOUT: // CHECK:STDOUT: !members: diff --git a/toolchain/check/testdata/class/redeclaration.carbon b/toolchain/check/testdata/class/redeclaration.carbon index 5485b6386e94..09f9189b23b0 100644 --- a/toolchain/check/testdata/class/redeclaration.carbon +++ b/toolchain/check/testdata/class/redeclaration.carbon @@ -17,9 +17,9 @@ fn Class.F() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "redeclaration.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %F: = fn_decl @F // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/reenter_scope.carbon b/toolchain/check/testdata/class/reenter_scope.carbon index 410a19d2e091..466e61429a08 100644 --- a/toolchain/check/testdata/class/reenter_scope.carbon +++ b/toolchain/check/testdata/class/reenter_scope.carbon @@ -18,7 +18,7 @@ fn Class.F() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "reenter_scope.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class // CHECK:STDOUT: %F: = fn_decl @F // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/scope.carbon b/toolchain/check/testdata/class/scope.carbon index 793319bf8c8a..a4d7a24266d5 100644 --- a/toolchain/check/testdata/class/scope.carbon +++ b/toolchain/check/testdata/class/scope.carbon @@ -27,7 +27,7 @@ fn Run() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "scope.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class // CHECK:STDOUT: %F: = fn_decl @F.2 // CHECK:STDOUT: %Run: = fn_decl @Run diff --git a/toolchain/check/testdata/class/self.carbon b/toolchain/check/testdata/class/self.carbon index eef416fb8ede..bf80a50c47c8 100644 --- a/toolchain/check/testdata/class/self.carbon +++ b/toolchain/check/testdata/class/self.carbon @@ -25,7 +25,7 @@ fn Class.G[addr self: Class*]() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "self.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class // CHECK:STDOUT: %F: = fn_decl @F // CHECK:STDOUT: %G: = fn_decl @G diff --git a/toolchain/check/testdata/class/self_type.carbon b/toolchain/check/testdata/class/self_type.carbon index 13742472f829..b6adb869e242 100644 --- a/toolchain/check/testdata/class/self_type.carbon +++ b/toolchain/check/testdata/class/self_type.carbon @@ -22,7 +22,7 @@ fn Class.F[self: Class]() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "self_type.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class // CHECK:STDOUT: %F: = fn_decl @F // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/static_method.carbon b/toolchain/check/testdata/class/static_method.carbon index 33929970c0de..817f1de076e4 100644 --- a/toolchain/check/testdata/class/static_method.carbon +++ b/toolchain/check/testdata/class/static_method.carbon @@ -20,7 +20,7 @@ fn Run() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "static_method.carbon" { -// CHECK:STDOUT: class_declaration @Class, () +// CHECK:STDOUT: class_decl @Class, () // CHECK:STDOUT: %Class: type = class_type @Class // CHECK:STDOUT: %Run: = fn_decl @Run // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/if_expression/fail_not_in_function.carbon b/toolchain/check/testdata/if_expression/fail_not_in_function.carbon index 541a1e07ad01..249b491589d2 100644 --- a/toolchain/check/testdata/if_expression/fail_not_in_function.carbon +++ b/toolchain/check/testdata/if_expression/fail_not_in_function.carbon @@ -40,7 +40,7 @@ class C { // CHECK:STDOUT: file "fail_not_in_function.carbon" { // CHECK:STDOUT: %.loc17: i32 = block_arg // CHECK:STDOUT: %x: i32 = bind_name x, %.loc17 -// CHECK:STDOUT: class_declaration @C, () +// CHECK:STDOUT: class_decl @C, () // CHECK:STDOUT: %C: type = class_type @C // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/fail_nested_incomplete.carbon b/toolchain/check/testdata/struct/fail_nested_incomplete.carbon index 50ff99f22c4c..13325bccda63 100644 --- a/toolchain/check/testdata/struct/fail_nested_incomplete.carbon +++ b/toolchain/check/testdata/struct/fail_nested_incomplete.carbon @@ -24,7 +24,7 @@ var p: Incomplete* = &s.a; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "fail_nested_incomplete.carbon" { -// CHECK:STDOUT: class_declaration @Incomplete, () +// CHECK:STDOUT: class_decl @Incomplete, () // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete // CHECK:STDOUT: %Incomplete.ref.loc15: type = name_reference Incomplete, %Incomplete // CHECK:STDOUT: %.loc15: type = struct_type {.a: Incomplete} diff --git a/toolchain/check/testdata/tuples/fail_nested_incomplete.carbon b/toolchain/check/testdata/tuples/fail_nested_incomplete.carbon index dd1bf9c4b5fb..95af1cb7ba75 100644 --- a/toolchain/check/testdata/tuples/fail_nested_incomplete.carbon +++ b/toolchain/check/testdata/tuples/fail_nested_incomplete.carbon @@ -26,7 +26,7 @@ var p: Incomplete* = &t[1]; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "fail_nested_incomplete.carbon" { -// CHECK:STDOUT: class_declaration @Incomplete, () +// CHECK:STDOUT: class_decl @Incomplete, () // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete // CHECK:STDOUT: %Incomplete.ref.loc15: type = name_reference Incomplete, %Incomplete // CHECK:STDOUT: %.loc15_24.1: (type, type) = tuple_literal (i32, %Incomplete.ref.loc15) diff --git a/toolchain/check/testdata/var/fail_not_copyable.carbon b/toolchain/check/testdata/var/fail_not_copyable.carbon index 0b5233afffa5..96b08a17a3db 100644 --- a/toolchain/check/testdata/var/fail_not_copyable.carbon +++ b/toolchain/check/testdata/var/fail_not_copyable.carbon @@ -30,7 +30,7 @@ fn F(x: X) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file "fail_not_copyable.carbon" { -// CHECK:STDOUT: class_declaration @X, () +// CHECK:STDOUT: class_decl @X, () // CHECK:STDOUT: %X: type = class_type @X // CHECK:STDOUT: %F: = fn_decl @F // CHECK:STDOUT: } diff --git a/toolchain/diagnostics/diagnostic_kind.def b/toolchain/diagnostics/diagnostic_kind.def index 01573f07aa9e..e90762251dfe 100644 --- a/toolchain/diagnostics/diagnostic_kind.def +++ b/toolchain/diagnostics/diagnostic_kind.def @@ -70,7 +70,7 @@ CARBON_DIAGNOSTIC_KIND(ExpectedParenAfter) CARBON_DIAGNOSTIC_KIND(ExpectedExprSemi) CARBON_DIAGNOSTIC_KIND(ExpectedStatementSemi) CARBON_DIAGNOSTIC_KIND(ExpectedStructLiteralField) -CARBON_DIAGNOSTIC_KIND(ExpectedVariableDeclaration) +CARBON_DIAGNOSTIC_KIND(ExpectedVariableDecl) CARBON_DIAGNOSTIC_KIND(ExpectedVariableName) CARBON_DIAGNOSTIC_KIND(OperatorRequiresParentheses) CARBON_DIAGNOSTIC_KIND(StatementOperatorAsSubexpr) @@ -78,10 +78,10 @@ CARBON_DIAGNOSTIC_KIND(UnaryOperatorRequiresParentheses) CARBON_DIAGNOSTIC_KIND(UnaryOperatorHasWhitespace) CARBON_DIAGNOSTIC_KIND(UnaryOperatorRequiresWhitespace) CARBON_DIAGNOSTIC_KIND(UnexpectedTokenAfterListElement) -CARBON_DIAGNOSTIC_KIND(UnrecognizedDeclaration) +CARBON_DIAGNOSTIC_KIND(UnrecognizedDecl) // Package-related diagnostics. -CARBON_DIAGNOSTIC_KIND(FirstDeclaration) +CARBON_DIAGNOSTIC_KIND(FirstDecl) CARBON_DIAGNOSTIC_KIND(FirstNonCommentLine) CARBON_DIAGNOSTIC_KIND(PackageTooLate) CARBON_DIAGNOSTIC_KIND(ImportTooLate) @@ -99,9 +99,9 @@ CARBON_DIAGNOSTIC_KIND(ExpectedThenAfterIf) CARBON_DIAGNOSTIC_KIND(ExpectedElseAfterIf) // Declaration diagnostics. -CARBON_DIAGNOSTIC_KIND(ExpectedDeclarationName) -CARBON_DIAGNOSTIC_KIND(ExpectedDeclarationSemi) -CARBON_DIAGNOSTIC_KIND(ExpectedDeclarationSemiOrDefinition) +CARBON_DIAGNOSTIC_KIND(ExpectedDeclName) +CARBON_DIAGNOSTIC_KIND(ExpectedDeclSemi) +CARBON_DIAGNOSTIC_KIND(ExpectedDeclSemiOrDefinition) CARBON_DIAGNOSTIC_KIND(ExpectedInitializerAfterLet) CARBON_DIAGNOSTIC_KIND(MethodImplNotAllowed) CARBON_DIAGNOSTIC_KIND(ParametersRequiredAfterImplicit) @@ -140,18 +140,18 @@ CARBON_DIAGNOSTIC_KIND(DereferenceOfType) CARBON_DIAGNOSTIC_KIND(FunctionPreviousDefinition) CARBON_DIAGNOSTIC_KIND(FunctionRedefinition) CARBON_DIAGNOSTIC_KIND(NameNotFound) -CARBON_DIAGNOSTIC_KIND(NameDeclarationDuplicate) -CARBON_DIAGNOSTIC_KIND(NameDeclarationPrevious) +CARBON_DIAGNOSTIC_KIND(NameDeclDuplicate) +CARBON_DIAGNOSTIC_KIND(NameDeclPrevious) CARBON_DIAGNOSTIC_KIND(MissingReturnStatement) CARBON_DIAGNOSTIC_KIND(RepeatedConst) CARBON_DIAGNOSTIC_KIND(IncompleteTypeInConversion) CARBON_DIAGNOSTIC_KIND(IncompleteTypeInFunctionParam) CARBON_DIAGNOSTIC_KIND(IncompleteTypeInFunctionReturnType) CARBON_DIAGNOSTIC_KIND(IncompleteTypeInInitialization) -CARBON_DIAGNOSTIC_KIND(IncompleteTypeInLetDeclaration) +CARBON_DIAGNOSTIC_KIND(IncompleteTypeInLetDecl) CARBON_DIAGNOSTIC_KIND(IncompleteTypeInMemberAccess) CARBON_DIAGNOSTIC_KIND(IncompleteTypeInValueConversion) -CARBON_DIAGNOSTIC_KIND(IncompleteTypeInVarDeclaration) +CARBON_DIAGNOSTIC_KIND(IncompleteTypeInVarDecl) CARBON_DIAGNOSTIC_KIND(InvalidArrayExpr) CARBON_DIAGNOSTIC_KIND(TypeNotIndexable) CARBON_DIAGNOSTIC_KIND(IndexOutOfBounds) @@ -168,9 +168,9 @@ CARBON_DIAGNOSTIC_KIND(ReturnStatementMissingExpr) CARBON_DIAGNOSTIC_KIND(ImplicitAsConversionFailure) CARBON_DIAGNOSTIC_KIND(ExplicitAsConversionFailure) CARBON_DIAGNOSTIC_KIND(TypeExprEvaluationFailure) -CARBON_DIAGNOSTIC_KIND(QualifiedDeclarationInIncompleteClassScope) -CARBON_DIAGNOSTIC_KIND(QualifiedDeclarationInNonScope) -CARBON_DIAGNOSTIC_KIND(QualifiedDeclarationNonScopeEntity) +CARBON_DIAGNOSTIC_KIND(QualifiedDeclInIncompleteClassScope) +CARBON_DIAGNOSTIC_KIND(QualifiedDeclInNonScope) +CARBON_DIAGNOSTIC_KIND(QualifiedDeclNonScopeEntity) CARBON_DIAGNOSTIC_KIND(QualifiedExprInIncompleteClassScope) CARBON_DIAGNOSTIC_KIND(QualifiedExprUnsupported) CARBON_DIAGNOSTIC_KIND(QualifiedExprNameNotFound) diff --git a/toolchain/diagnostics/diagnostic_kind.h b/toolchain/diagnostics/diagnostic_kind.h index db7598f160ab..ea04fcd7d4d5 100644 --- a/toolchain/diagnostics/diagnostic_kind.h +++ b/toolchain/diagnostics/diagnostic_kind.h @@ -29,7 +29,7 @@ CARBON_DEFINE_RAW_ENUM_CLASS(DiagnosticKind, uint16_t) { // to the consuming code. class DiagnosticKind : public CARBON_ENUM_BASE(DiagnosticKind) { public: -#define CARBON_DIAGNOSTIC_KIND(Name) CARBON_ENUM_CONSTANT_DECLARATION(Name) +#define CARBON_DIAGNOSTIC_KIND(Name) CARBON_ENUM_CONSTANT_DECL(Name) #include "toolchain/diagnostics/diagnostic_kind.def" }; diff --git a/toolchain/lex/token_kind.h b/toolchain/lex/token_kind.h index 1b2988097ab8..87a7e5afe71e 100644 --- a/toolchain/lex/token_kind.h +++ b/toolchain/lex/token_kind.h @@ -22,7 +22,7 @@ CARBON_DEFINE_RAW_ENUM_CLASS(TokenKind, uint8_t) { class TokenKind : public CARBON_ENUM_BASE(TokenKind) { public: -#define CARBON_TOKEN(TokenName) CARBON_ENUM_CONSTANT_DECLARATION(TokenName) +#define CARBON_TOKEN(TokenName) CARBON_ENUM_CONSTANT_DECL(TokenName) #include "toolchain/lex/token_kind.def" // An array of all the keyword tokens. diff --git a/toolchain/lower/file_context.cpp b/toolchain/lower/file_context.cpp index 8be2112b7c49..04f4671b2fcd 100644 --- a/toolchain/lower/file_context.cpp +++ b/toolchain/lower/file_context.cpp @@ -41,7 +41,7 @@ auto FileContext::Run() -> std::unique_ptr { // Lower function declarations. functions_.resize_for_overwrite(sem_ir_->functions().size()); for (auto i : llvm::seq(sem_ir_->functions().size())) { - functions_[i] = BuildFunctionDeclaration(SemIR::FunctionId(i)); + functions_[i] = BuildFunctionDecl(SemIR::FunctionId(i)); } // TODO: Lower global variable declarations. @@ -63,7 +63,7 @@ auto FileContext::GetGlobal(SemIR::InstId inst_id) -> llvm::Value* { } auto target = sem_ir().insts().Get(inst_id); - if (auto function_decl = target.TryAs()) { + if (auto function_decl = target.TryAs()) { return GetFunction(function_decl->function_id); } @@ -74,7 +74,7 @@ auto FileContext::GetGlobal(SemIR::InstId inst_id) -> llvm::Value* { CARBON_FATAL() << "Missing value: " << inst_id << " " << target; } -auto FileContext::BuildFunctionDeclaration(SemIR::FunctionId function_id) +auto FileContext::BuildFunctionDecl(SemIR::FunctionId function_id) -> llvm::Function* { const auto& function = sem_ir().functions().Get(function_id); const bool has_return_slot = function.return_slot_id.is_valid(); @@ -186,7 +186,7 @@ auto FileContext::BuildFunctionDefinition(SemIR::FunctionId function_id) // Add parameters to locals. // TODO: This duplicates the mapping between sem_ir instructions and LLVM - // function parameters that was already computed in BuildFunctionDeclaration. + // function parameters that was already computed in BuildFunctionDecl. // We should only do that once. auto implicit_param_refs = sem_ir().inst_blocks().Get(function.implicit_param_refs_id); diff --git a/toolchain/lower/file_context.h b/toolchain/lower/file_context.h index 34a49257d107..35cd459db356 100644 --- a/toolchain/lower/file_context.h +++ b/toolchain/lower/file_context.h @@ -56,8 +56,7 @@ class FileContext { private: // Builds the declaration for the given function, which should then be cached // by the caller. - auto BuildFunctionDeclaration(SemIR::FunctionId function_id) - -> llvm::Function*; + auto BuildFunctionDecl(SemIR::FunctionId function_id) -> llvm::Function*; // Builds the definition for the given function. If the function is only a // declaration with no definition, does nothing. diff --git a/toolchain/lower/handle.cpp b/toolchain/lower/handle.cpp index 9a0dd901b93d..155a35f12da1 100644 --- a/toolchain/lower/handle.cpp +++ b/toolchain/lower/handle.cpp @@ -179,9 +179,8 @@ auto HandleDereference(FunctionContext& context, SemIR::InstId inst_id, context.SetLocal(inst_id, context.GetValue(inst.pointer_id)); } -auto HandleFunctionDeclaration(FunctionContext& /*context*/, - SemIR::InstId /*inst_id*/, - SemIR::FunctionDeclaration inst) -> void { +auto HandleFunctionDecl(FunctionContext& /*context*/, SemIR::InstId /*inst_id*/, + SemIR::FunctionDecl inst) -> void { CARBON_FATAL() << "Should not be encountered. If that changes, we may want to change " "higher-level logic to skip them rather than calling this. " diff --git a/toolchain/lower/handle_aggregates.cpp b/toolchain/lower/handle_aggregates.cpp index 1d66a2429648..3ba315e5e69d 100644 --- a/toolchain/lower/handle_aggregates.cpp +++ b/toolchain/lower/handle_aggregates.cpp @@ -13,9 +13,8 @@ namespace Carbon::Lower { -auto HandleClassDeclaration(FunctionContext& /*context*/, - SemIR::InstId /*inst_id*/, - SemIR::ClassDeclaration /*inst*/) -> void { +auto HandleClassDecl(FunctionContext& /*context*/, SemIR::InstId /*inst_id*/, + SemIR::ClassDecl /*inst*/) -> void { // No action to perform. } diff --git a/toolchain/parse/context.cpp b/toolchain/parse/context.cpp index 0072b624d144..b1012310afec 100644 --- a/toolchain/parse/context.cpp +++ b/toolchain/parse/context.cpp @@ -391,33 +391,33 @@ auto Context::ConsumeListToken(NodeKind comma_kind, Lex::TokenKind close_kind, } } -auto Context::GetDeclarationContext() -> DeclarationContext { - // i == 0 is the file-level DeclarationScopeLoop. Additionally, i == 1 can be - // skipped because it will never be a DeclarationScopeLoop. +auto Context::GetDeclContext() -> DeclContext { + // i == 0 is the file-level DeclScopeLoop. Additionally, i == 1 can be + // skipped because it will never be a DeclScopeLoop. for (int i = state_stack_.size() - 1; i > 1; --i) { // The declaration context is always the state _above_ a - // DeclarationScopeLoop. - if (state_stack_[i].state == State::DeclarationScopeLoop) { + // DeclScopeLoop. + if (state_stack_[i].state == State::DeclScopeLoop) { switch (state_stack_[i - 1].state) { case State::TypeDefinitionFinishAsClass: - return DeclarationContext::Class; + return DeclContext::Class; case State::TypeDefinitionFinishAsInterface: - return DeclarationContext::Interface; + return DeclContext::Interface; case State::TypeDefinitionFinishAsNamedConstraint: - return DeclarationContext::NamedConstraint; + return DeclContext::NamedConstraint; default: llvm_unreachable("Missing handling for a declaration scope"); } } } CARBON_CHECK(!state_stack_.empty() && - state_stack_[0].state == State::DeclarationScopeLoop); - return DeclarationContext::File; + state_stack_[0].state == State::DeclScopeLoop); + return DeclContext::File; } -auto Context::RecoverFromDeclarationError(StateStackEntry state, - NodeKind parse_node_kind, - bool skip_past_likely_end) -> void { +auto Context::RecoverFromDeclError(StateStackEntry state, + NodeKind parse_node_kind, + bool skip_past_likely_end) -> void { auto token = state.token; if (skip_past_likely_end) { if (auto semi = SkipPastLikelyEnd(token)) { @@ -428,21 +428,19 @@ auto Context::RecoverFromDeclarationError(StateStackEntry state, /*has_error=*/true); } -auto Context::EmitExpectedDeclarationSemi(Lex::TokenKind expected_kind) - -> void { - CARBON_DIAGNOSTIC(ExpectedDeclarationSemi, Error, +auto Context::EmitExpectedDeclSemi(Lex::TokenKind expected_kind) -> void { + CARBON_DIAGNOSTIC(ExpectedDeclSemi, Error, "`{0}` declarations must end with a `;`.", Lex::TokenKind); - emitter().Emit(*position(), ExpectedDeclarationSemi, expected_kind); + emitter().Emit(*position(), ExpectedDeclSemi, expected_kind); } -auto Context::EmitExpectedDeclarationSemiOrDefinition( - Lex::TokenKind expected_kind) -> void { - CARBON_DIAGNOSTIC(ExpectedDeclarationSemiOrDefinition, Error, +auto Context::EmitExpectedDeclSemiOrDefinition(Lex::TokenKind expected_kind) + -> void { + CARBON_DIAGNOSTIC(ExpectedDeclSemiOrDefinition, Error, "`{0}` declarations must either end with a `;` or " "have a `{{ ... }` block for a definition.", Lex::TokenKind); - emitter().Emit(*position(), ExpectedDeclarationSemiOrDefinition, - expected_kind); + emitter().Emit(*position(), ExpectedDeclSemiOrDefinition, expected_kind); } auto Context::PrintForStackDump(llvm::raw_ostream& output) const -> void { diff --git a/toolchain/parse/context.h b/toolchain/parse/context.h index d886ca7a6764..3b291f05352e 100644 --- a/toolchain/parse/context.h +++ b/toolchain/parse/context.h @@ -36,8 +36,8 @@ class Context { Let }; - // Supported return values for GetDeclarationContext. - enum class DeclarationContext : int8_t { + // Supported return values for GetDeclContext. + enum class DeclContext : int8_t { File, // Top-level context. Class, Interface, @@ -48,11 +48,11 @@ class Context { enum class PackagingState : int8_t { StartOfFile, InImports, - AfterNonPackagingDeclaration, + AfterNonPackagingDecl, // A warning about `import` placement has been issued so we don't keep // issuing more (when `import` is repeated) until more non-`import` // declarations come up. - InImportsAfterNonPackagingDeclaration, + InImportsAfterNonPackagingDecl, }; // Used to track state on state_stack_. @@ -266,8 +266,8 @@ class Context { // parses should only need to look down a couple steps. // // This currently assumes it's being called from within the declaration's - // DeclarationScopeLoop. - auto GetDeclarationContext() -> DeclarationContext; + // DeclScopeLoop. + auto GetDeclContext() -> DeclContext; // Propagates an error up the state stack, to the parent state. auto ReturnErrorOnState() -> void { state_stack_.back().has_error = true; } @@ -277,19 +277,17 @@ class Context { State keyword_state, int subtree_start) -> void; // Emits a diagnostic for a declaration missing a semi. - auto EmitExpectedDeclarationSemi(Lex::TokenKind expected_kind) -> void; + auto EmitExpectedDeclSemi(Lex::TokenKind expected_kind) -> void; // Emits a diagnostic for a declaration missing a semi or definition. - auto EmitExpectedDeclarationSemiOrDefinition(Lex::TokenKind expected_kind) - -> void; + auto EmitExpectedDeclSemiOrDefinition(Lex::TokenKind expected_kind) -> void; // Handles error recovery in a declaration, particularly before any possible // definition has started (although one could be present). Recover to a // semicolon when it makes sense as a possible end, otherwise use the // introducer token for the error. - auto RecoverFromDeclarationError(StateStackEntry state, - NodeKind parse_node_kind, - bool skip_past_likely_end) -> void; + auto RecoverFromDeclError(StateStackEntry state, NodeKind parse_node_kind, + bool skip_past_likely_end) -> void; // Prints information for a stack dump. auto PrintForStackDump(llvm::raw_ostream& output) const -> void; diff --git a/toolchain/parse/handle_declaration_name_and_params.cpp b/toolchain/parse/handle_declaration_name_and_params.cpp index 4b24a26636cb..9d469a612694 100644 --- a/toolchain/parse/handle_declaration_name_and_params.cpp +++ b/toolchain/parse/handle_declaration_name_and_params.cpp @@ -6,8 +6,8 @@ namespace Carbon::Parse { -// Handles DeclarationNameAndParamsAs(Optional|Required). -static auto HandleDeclarationNameAndParams(Context& context, State after_name) +// Handles DeclNameAndParamsAs(Optional|Required). +static auto HandleDeclNameAndParams(Context& context, State after_name) -> void { auto state = context.PopState(); @@ -18,16 +18,16 @@ static auto HandleDeclarationNameAndParams(Context& context, State after_name) if (context.PositionIs(Lex::TokenKind::Period)) { context.AddLeafNode(NodeKind::Name, *identifier); - state.state = State::PeriodAsDeclaration; + state.state = State::PeriodAsDecl; context.PushState(state); } else { context.AddLeafNode(NodeKind::Name, *identifier); } } else { - CARBON_DIAGNOSTIC(ExpectedDeclarationName, Error, + CARBON_DIAGNOSTIC(ExpectedDeclName, Error, "`{0}` introducer should be followed by a name.", Lex::TokenKind); - context.emitter().Emit(*context.position(), ExpectedDeclarationName, + context.emitter().Emit(*context.position(), ExpectedDeclName, context.tokens().GetKind(state.token)); context.ReturnErrorOnState(); context.AddLeafNode(NodeKind::InvalidParse, *context.position(), @@ -35,19 +35,16 @@ static auto HandleDeclarationNameAndParams(Context& context, State after_name) } } -auto HandleDeclarationNameAndParamsAsNone(Context& context) -> void { - HandleDeclarationNameAndParams( - context, State::DeclarationNameAndParamsAfterNameAsNone); +auto HandleDeclNameAndParamsAsNone(Context& context) -> void { + HandleDeclNameAndParams(context, State::DeclNameAndParamsAfterNameAsNone); } -auto HandleDeclarationNameAndParamsAsOptional(Context& context) -> void { - HandleDeclarationNameAndParams( - context, State::DeclarationNameAndParamsAfterNameAsOptional); +auto HandleDeclNameAndParamsAsOptional(Context& context) -> void { + HandleDeclNameAndParams(context, State::DeclNameAndParamsAfterNameAsOptional); } -auto HandleDeclarationNameAndParamsAsRequired(Context& context) -> void { - HandleDeclarationNameAndParams( - context, State::DeclarationNameAndParamsAfterNameAsRequired); +auto HandleDeclNameAndParamsAsRequired(Context& context) -> void { + HandleDeclNameAndParams(context, State::DeclNameAndParamsAfterNameAsRequired); } enum class Params : int8_t { @@ -56,14 +53,14 @@ enum class Params : int8_t { Required, }; -static auto HandleDeclarationNameAndParamsAfterName(Context& context, - Params params) -> void { +static auto HandleDeclNameAndParamsAfterName(Context& context, Params params) + -> void { auto state = context.PopState(); if (context.PositionIs(Lex::TokenKind::Period)) { // Continue designator processing. context.PushState(state); - state.state = State::PeriodAsDeclaration; + state.state = State::PeriodAsDecl; context.PushState(state); return; } @@ -73,7 +70,7 @@ static auto HandleDeclarationNameAndParamsAfterName(Context& context, // // fn Class(T:! type).AnotherClass(U:! type).Function(v: T) {} // - // We should retain a `DeclarationNameAndParams...` state on the stack in all + // We should retain a `DeclNameAndParams...` state on the stack in all // cases below to check for a period after a parameter list, which indicates // that we've not finished parsing the declaration name. @@ -82,7 +79,7 @@ static auto HandleDeclarationNameAndParamsAfterName(Context& context, } if (context.PositionIs(Lex::TokenKind::OpenSquareBracket)) { - context.PushState(State::DeclarationNameAndParamsAfterImplicit); + context.PushState(State::DeclNameAndParamsAfterImplicit); context.PushState(State::ParameterListAsImplicit); } else if (context.PositionIs(Lex::TokenKind::OpenParen)) { context.PushState(State::ParameterListAsRegular); @@ -95,21 +92,19 @@ static auto HandleDeclarationNameAndParamsAfterName(Context& context, } } -auto HandleDeclarationNameAndParamsAfterNameAsNone(Context& context) -> void { - HandleDeclarationNameAndParamsAfterName(context, Params::None); +auto HandleDeclNameAndParamsAfterNameAsNone(Context& context) -> void { + HandleDeclNameAndParamsAfterName(context, Params::None); } -auto HandleDeclarationNameAndParamsAfterNameAsOptional(Context& context) - -> void { - HandleDeclarationNameAndParamsAfterName(context, Params::Optional); +auto HandleDeclNameAndParamsAfterNameAsOptional(Context& context) -> void { + HandleDeclNameAndParamsAfterName(context, Params::Optional); } -auto HandleDeclarationNameAndParamsAfterNameAsRequired(Context& context) - -> void { - HandleDeclarationNameAndParamsAfterName(context, Params::Required); +auto HandleDeclNameAndParamsAfterNameAsRequired(Context& context) -> void { + HandleDeclNameAndParamsAfterName(context, Params::Required); } -auto HandleDeclarationNameAndParamsAfterImplicit(Context& context) -> void { +auto HandleDeclNameAndParamsAfterImplicit(Context& context) -> void { context.PopAndDiscardState(); if (context.PositionIs(Lex::TokenKind::OpenParen)) { diff --git a/toolchain/parse/handle_declaration_scope_loop.cpp b/toolchain/parse/handle_declaration_scope_loop.cpp index 2566d6018e48..1685bf06da06 100644 --- a/toolchain/parse/handle_declaration_scope_loop.cpp +++ b/toolchain/parse/handle_declaration_scope_loop.cpp @@ -7,19 +7,19 @@ namespace Carbon::Parse { // Handles an unrecognized declaration, adding an error node. -static auto HandleUnrecognizedDeclaration(Context& context) -> void { - CARBON_DIAGNOSTIC(UnrecognizedDeclaration, Error, +static auto HandleUnrecognizedDecl(Context& context) -> void { + CARBON_DIAGNOSTIC(UnrecognizedDecl, Error, "Unrecognized declaration introducer."); - context.emitter().Emit(*context.position(), UnrecognizedDeclaration); + context.emitter().Emit(*context.position(), UnrecognizedDecl); auto cursor = *context.position(); auto semi = context.SkipPastLikelyEnd(cursor); - // Locate the EmptyDeclaration at the semi when found, but use the + // Locate the EmptyDecl at the semi when found, but use the // original cursor location for an error when not. - context.AddLeafNode(NodeKind::EmptyDeclaration, semi ? *semi : cursor, + context.AddLeafNode(NodeKind::EmptyDecl, semi ? *semi : cursor, /*has_error=*/true); } -auto HandleDeclarationScopeLoop(Context& context) -> void { +auto HandleDeclScopeLoop(Context& context) -> void { // This maintains the current state unless we're at the end of the scope. switch (auto position_kind = context.PositionKind()) { @@ -42,12 +42,12 @@ auto HandleDeclarationScopeLoop(Context& context) -> void { // Because a non-packaging keyword was encountered, packaging is complete. // Misplaced packaging keywords may lead to this being re-triggered. if (context.packaging_state() != - Context::PackagingState::AfterNonPackagingDeclaration) { + Context::PackagingState::AfterNonPackagingDecl) { if (!context.first_non_packaging_token().is_valid()) { context.set_first_non_packaging_token(*context.position()); } context.set_packaging_state( - Context::PackagingState::AfterNonPackagingDeclaration); + Context::PackagingState::AfterNonPackagingDecl); } switch (position_kind) { // Remaining keywords are only valid after imports are complete, and @@ -74,7 +74,7 @@ auto HandleDeclarationScopeLoop(Context& context) -> void { break; } case Lex::TokenKind::Semi: { - context.AddLeafNode(NodeKind::EmptyDeclaration, context.Consume()); + context.AddLeafNode(NodeKind::EmptyDecl, context.Consume()); break; } case Lex::TokenKind::Var: { @@ -86,7 +86,7 @@ auto HandleDeclarationScopeLoop(Context& context) -> void { break; } default: { - HandleUnrecognizedDeclaration(context); + HandleUnrecognizedDecl(context); break; } } diff --git a/toolchain/parse/handle_function.cpp b/toolchain/parse/handle_function.cpp index a8b5b351dda7..dae8b45e6323 100644 --- a/toolchain/parse/handle_function.cpp +++ b/toolchain/parse/handle_function.cpp @@ -13,7 +13,7 @@ auto HandleFunctionIntroducer(Context& context) -> void { state.state = State::FunctionAfterParameters; context.PushState(state); - context.PushState(State::DeclarationNameAndParamsAsRequired, state.token); + context.PushState(State::DeclNameAndParamsAsRequired, state.token); } auto HandleFunctionAfterParameters(Context& context) -> void { @@ -44,21 +44,20 @@ auto HandleFunctionSignatureFinish(Context& context) -> void { switch (context.PositionKind()) { case Lex::TokenKind::Semi: { - context.AddNode(NodeKind::FunctionDeclaration, context.Consume(), + context.AddNode(NodeKind::FunctionDecl, context.Consume(), state.subtree_start, state.has_error); break; } case Lex::TokenKind::OpenCurlyBrace: { - if (auto decl_context = context.GetDeclarationContext(); - decl_context == Context::DeclarationContext::Interface || - decl_context == Context::DeclarationContext::NamedConstraint) { + if (auto decl_context = context.GetDeclContext(); + decl_context == Context::DeclContext::Interface || + decl_context == Context::DeclContext::NamedConstraint) { CARBON_DIAGNOSTIC( MethodImplNotAllowed, Error, "Method implementations are not allowed in interfaces."); context.emitter().Emit(*context.position(), MethodImplNotAllowed); - context.RecoverFromDeclarationError(state, - NodeKind::FunctionDeclaration, - /*skip_past_likely_end=*/true); + context.RecoverFromDeclError(state, NodeKind::FunctionDecl, + /*skip_past_likely_end=*/true); break; } @@ -73,14 +72,14 @@ auto HandleFunctionSignatureFinish(Context& context) -> void { } default: { if (!state.has_error) { - context.EmitExpectedDeclarationSemiOrDefinition(Lex::TokenKind::Fn); + context.EmitExpectedDeclSemiOrDefinition(Lex::TokenKind::Fn); } // Only need to skip if we've not already found a new line. bool skip_past_likely_end = context.tokens().GetLine(*context.position()) == context.tokens().GetLine(state.token); - context.RecoverFromDeclarationError(state, NodeKind::FunctionDeclaration, - skip_past_likely_end); + context.RecoverFromDeclError(state, NodeKind::FunctionDecl, + skip_past_likely_end); break; } } diff --git a/toolchain/parse/handle_import_and_package.cpp b/toolchain/parse/handle_import_and_package.cpp index bf5262d02774..d9a7d97144e0 100644 --- a/toolchain/parse/handle_import_and_package.cpp +++ b/toolchain/parse/handle_import_and_package.cpp @@ -84,7 +84,7 @@ static auto HandleImportAndPackage(Context& context, } if (!context.PositionIs(Lex::TokenKind::Semi)) { - context.EmitExpectedDeclarationSemi(context.tokens().GetKind(state.token)); + context.EmitExpectedDeclSemi(context.tokens().GetKind(state.token)); ExitOnParseError(context, state, directive); return; } @@ -110,22 +110,22 @@ auto HandleImport(Context& context) -> void { /*expect_api_or_impl=*/false); break; - case Context::PackagingState::AfterNonPackagingDeclaration: { + case Context::PackagingState::AfterNonPackagingDecl: { context.set_packaging_state( - Context::PackagingState::InImportsAfterNonPackagingDeclaration); + Context::PackagingState::InImportsAfterNonPackagingDecl); CARBON_DIAGNOSTIC( ImportTooLate, Error, "`import` directives must come after the `package` directive (if " "present) and before any other entities in the file."); - CARBON_DIAGNOSTIC(FirstDeclaration, Note, "First declaration is here."); + CARBON_DIAGNOSTIC(FirstDecl, Note, "First declaration is here."); context.emitter() .Build(intro_token, ImportTooLate) - .Note(context.first_non_packaging_token(), FirstDeclaration) + .Note(context.first_non_packaging_token(), FirstDecl) .Emit(); ExitOnParseError(context, state, NodeKind::ImportDirective); break; } - case Context::PackagingState::InImportsAfterNonPackagingDeclaration: + case Context::PackagingState::InImportsAfterNonPackagingDecl: // There is a sequential block of misplaced `import` statements, which can // occur if a declaration is added above `import`s. Avoid duplicate // warnings. diff --git a/toolchain/parse/handle_let.cpp b/toolchain/parse/handle_let.cpp index e362a4eda512..eb75271e0c50 100644 --- a/toolchain/parse/handle_let.cpp +++ b/toolchain/parse/handle_let.cpp @@ -48,13 +48,13 @@ auto HandleLetFinish(Context& context) -> void { if (context.PositionIs(Lex::TokenKind::Semi)) { end_token = context.Consume(); } else { - context.EmitExpectedDeclarationSemi(Lex::TokenKind::Let); + context.EmitExpectedDeclSemi(Lex::TokenKind::Let); state.has_error = true; if (auto semi_token = context.SkipPastLikelyEnd(state.token)) { end_token = *semi_token; } } - context.AddNode(NodeKind::LetDeclaration, end_token, state.subtree_start, + context.AddNode(NodeKind::LetDecl, end_token, state.subtree_start, state.has_error); } diff --git a/toolchain/parse/handle_namespace.cpp b/toolchain/parse/handle_namespace.cpp index a9744dcc147a..921e15eb2759 100644 --- a/toolchain/parse/handle_namespace.cpp +++ b/toolchain/parse/handle_namespace.cpp @@ -14,15 +14,15 @@ auto HandleNamespace(Context& context) -> void { state.state = State::NamespaceFinish; context.PushState(state); - context.PushState(State::DeclarationNameAndParamsAsNone, state.token); + context.PushState(State::DeclNameAndParamsAsNone, state.token); } auto HandleNamespaceFinish(Context& context) -> void { auto state = context.PopState(); if (state.has_error) { - context.RecoverFromDeclarationError(state, NodeKind::Namespace, - /*skip_past_likely_end=*/true); + context.RecoverFromDeclError(state, NodeKind::Namespace, + /*skip_past_likely_end=*/true); return; } @@ -30,9 +30,9 @@ auto HandleNamespaceFinish(Context& context) -> void { context.AddNode(NodeKind::Namespace, *semi, state.subtree_start, state.has_error); } else { - context.EmitExpectedDeclarationSemi(Lex::TokenKind::Namespace); - context.RecoverFromDeclarationError(state, NodeKind::Namespace, - /*skip_past_likely_end=*/true); + context.EmitExpectedDeclSemi(Lex::TokenKind::Namespace); + context.RecoverFromDeclError(state, NodeKind::Namespace, + /*skip_past_likely_end=*/true); } } diff --git a/toolchain/parse/handle_period.cpp b/toolchain/parse/handle_period.cpp index 352dea6db7f4..3872c20b0eb5 100644 --- a/toolchain/parse/handle_period.cpp +++ b/toolchain/parse/handle_period.cpp @@ -41,8 +41,8 @@ static auto HandlePeriodOrArrow(Context& context, NodeKind node_kind, context.AddNode(node_kind, dot, state.subtree_start, state.has_error); } -auto HandlePeriodAsDeclaration(Context& context) -> void { - HandlePeriodOrArrow(context, NodeKind::QualifiedDeclaration, +auto HandlePeriodAsDecl(Context& context) -> void { + HandlePeriodOrArrow(context, NodeKind::QualifiedDecl, /*is_arrow=*/false); } diff --git a/toolchain/parse/handle_statement.cpp b/toolchain/parse/handle_statement.cpp index f488d080cde6..74abd58e8f4a 100644 --- a/toolchain/parse/handle_statement.cpp +++ b/toolchain/parse/handle_statement.cpp @@ -98,9 +98,9 @@ auto HandleStatementForHeader(Context& context) -> void { context.PushState(state); context.PushState(State::VarAsFor); } else { - CARBON_DIAGNOSTIC(ExpectedVariableDeclaration, Error, + CARBON_DIAGNOSTIC(ExpectedVariableDecl, Error, "Expected `var` declaration."); - context.emitter().Emit(*context.position(), ExpectedVariableDeclaration); + context.emitter().Emit(*context.position(), ExpectedVariableDecl); if (auto next_in = context.FindNextOf({Lex::TokenKind::In})) { context.SkipTo(*next_in); diff --git a/toolchain/parse/handle_type.cpp b/toolchain/parse/handle_type.cpp index 79f2352f59a7..a0c199ef5457 100644 --- a/toolchain/parse/handle_type.cpp +++ b/toolchain/parse/handle_type.cpp @@ -15,7 +15,7 @@ static auto HandleTypeIntroducer(Context& context, NodeKind introducer_kind, state.state = after_params_state; context.PushState(state); - context.PushState(State::DeclarationNameAndParamsAsOptional, state.token); + context.PushState(State::DeclNameAndParamsAsOptional, state.token); } auto HandleTypeIntroducerAsClass(Context& context) -> void { @@ -35,52 +35,51 @@ auto HandleTypeIntroducerAsNamedConstraint(Context& context) -> void { // Handles processing after params, deciding whether it's a declaration or // definition. -static auto HandleTypeAfterParams(Context& context, NodeKind declaration_kind, +static auto HandleTypeAfterParams(Context& context, NodeKind decl_kind, NodeKind definition_start_kind, State definition_finish_state) -> void { auto state = context.PopState(); if (state.has_error) { - context.RecoverFromDeclarationError(state, declaration_kind, - /*skip_past_likely_end=*/true); + context.RecoverFromDeclError(state, decl_kind, + /*skip_past_likely_end=*/true); return; } if (auto semi = context.ConsumeIf(Lex::TokenKind::Semi)) { - context.AddNode(declaration_kind, *semi, state.subtree_start, - state.has_error); + context.AddNode(decl_kind, *semi, state.subtree_start, state.has_error); return; } if (!context.PositionIs(Lex::TokenKind::OpenCurlyBrace)) { - context.EmitExpectedDeclarationSemiOrDefinition( + context.EmitExpectedDeclSemiOrDefinition( context.tokens().GetKind(state.token)); - context.RecoverFromDeclarationError(state, declaration_kind, - /*skip_past_likely_end=*/true); + context.RecoverFromDeclError(state, decl_kind, + /*skip_past_likely_end=*/true); return; } state.state = definition_finish_state; context.PushState(state); - context.PushState(State::DeclarationScopeLoop); + context.PushState(State::DeclScopeLoop); context.AddNode(definition_start_kind, context.Consume(), state.subtree_start, state.has_error); } auto HandleTypeAfterParamsAsClass(Context& context) -> void { - HandleTypeAfterParams(context, NodeKind::ClassDeclaration, + HandleTypeAfterParams(context, NodeKind::ClassDecl, NodeKind::ClassDefinitionStart, State::TypeDefinitionFinishAsClass); } auto HandleTypeAfterParamsAsInterface(Context& context) -> void { - HandleTypeAfterParams(context, NodeKind::InterfaceDeclaration, + HandleTypeAfterParams(context, NodeKind::InterfaceDecl, NodeKind::InterfaceDefinitionStart, State::TypeDefinitionFinishAsInterface); } auto HandleTypeAfterParamsAsNamedConstraint(Context& context) -> void { - HandleTypeAfterParams(context, NodeKind::NamedConstraintDeclaration, + HandleTypeAfterParams(context, NodeKind::NamedConstraintDecl, NodeKind::NamedConstraintDefinitionStart, State::TypeDefinitionFinishAsNamedConstraint); } diff --git a/toolchain/parse/handle_var.cpp b/toolchain/parse/handle_var.cpp index 5c56d1a1d15e..3d8e031d5d7d 100644 --- a/toolchain/parse/handle_var.cpp +++ b/toolchain/parse/handle_var.cpp @@ -52,13 +52,13 @@ auto HandleVarFinishAsSemicolon(Context& context) -> void { end_token = context.Consume(); } else { // TODO: Disambiguate between statement and member declaration. - context.EmitExpectedDeclarationSemi(Lex::TokenKind::Var); + context.EmitExpectedDeclSemi(Lex::TokenKind::Var); state.has_error = true; if (auto semi_token = context.SkipPastLikelyEnd(state.token)) { end_token = *semi_token; } } - context.AddNode(NodeKind::VariableDeclaration, end_token, state.subtree_start, + context.AddNode(NodeKind::VariableDecl, end_token, state.subtree_start, state.has_error); } diff --git a/toolchain/parse/node_kind.def b/toolchain/parse/node_kind.def index 131c8fd2401e..bad9906aa5bb 100644 --- a/toolchain/parse/node_kind.def +++ b/toolchain/parse/node_kind.def @@ -58,7 +58,7 @@ CARBON_PARSE_NODE_KIND_CHILD_COUNT(InvalidParse, 0, CARBON_IF_ERROR(CARBON_ANY_TOKEN)) // An empty declaration, such as `;`. -CARBON_PARSE_NODE_KIND_CHILD_COUNT(EmptyDeclaration, 0, +CARBON_PARSE_NODE_KIND_CHILD_COUNT(EmptyDecl, 0, CARBON_TOKEN(Semi) CARBON_IF_ERROR(CARBON_ANY_TOKEN)) @@ -125,7 +125,7 @@ CARBON_PARSE_NODE_KIND_BRACKET(ImportDirective, ImportIntroducer, // `namespace`: // NamespaceStart -// _external_: Name or QualifiedDeclaration +// _external_: Name or QualifiedDecl // Namespace CARBON_PARSE_NODE_KIND_CHILD_COUNT(NamespaceStart, 0, CARBON_TOKEN(Namespace)) CARBON_PARSE_NODE_KIND_CHILD_COUNT(Namespace, 2, CARBON_TOKEN(Semi)) @@ -143,7 +143,7 @@ CARBON_PARSE_NODE_KIND_BRACKET(CodeBlock, CodeBlockStart, // `fn`: // FunctionIntroducer -// _external_: Name or QualifiedDeclaration +// _external_: Name or QualifiedDecl // _external_: ParameterList // _external_: type expression // ReturnType @@ -153,14 +153,14 @@ CARBON_PARSE_NODE_KIND_BRACKET(CodeBlock, CodeBlockStart, // // The above is the structure for a definition; for a declaration, // FunctionDefinitionStart and later nodes are removed and replaced by -// FunctionDeclaration. +// FunctionDecl. CARBON_PARSE_NODE_KIND_CHILD_COUNT(FunctionIntroducer, 0, CARBON_TOKEN(Fn)) CARBON_PARSE_NODE_KIND_CHILD_COUNT(ReturnType, 1, CARBON_TOKEN(MinusGreater)) CARBON_PARSE_NODE_KIND_BRACKET(FunctionDefinitionStart, FunctionIntroducer, CARBON_TOKEN(OpenCurlyBrace)) CARBON_PARSE_NODE_KIND_BRACKET(FunctionDefinition, FunctionDefinitionStart, CARBON_TOKEN(CloseCurlyBrace)) -CARBON_PARSE_NODE_KIND_BRACKET(FunctionDeclaration, FunctionIntroducer, +CARBON_PARSE_NODE_KIND_BRACKET(FunctionDecl, FunctionIntroducer, CARBON_TOKEN(Semi) CARBON_IF_ERROR(CARBON_TOKEN(Fn))) @@ -216,10 +216,10 @@ CARBON_PARSE_NODE_KIND_CHILD_COUNT(Template, 1, CARBON_TOKEN(Template)) // _external_: PatternBinding // LetInitializer // _external_: expression -// LetDeclaration +// LetDecl CARBON_PARSE_NODE_KIND_CHILD_COUNT(LetIntroducer, 0, CARBON_TOKEN(Let)) CARBON_PARSE_NODE_KIND_CHILD_COUNT(LetInitializer, 0, CARBON_TOKEN(Equal)) -CARBON_PARSE_NODE_KIND_BRACKET(LetDeclaration, LetIntroducer, +CARBON_PARSE_NODE_KIND_BRACKET(LetDecl, LetIntroducer, CARBON_TOKEN(Semi) CARBON_IF_ERROR(CARBON_TOKEN(Let))) @@ -228,13 +228,13 @@ CARBON_PARSE_NODE_KIND_BRACKET(LetDeclaration, LetIntroducer, // _external_: PatternBinding // _optional_ VariableInitializer // _optional_ _external_: expression -// VariableDeclaration +// VariableDecl // // The VariableInitializer and following expression are paired: either both will // be present, or neither will. CARBON_PARSE_NODE_KIND_CHILD_COUNT(VariableIntroducer, 0, CARBON_TOKEN(Var)) CARBON_PARSE_NODE_KIND_CHILD_COUNT(VariableInitializer, 0, CARBON_TOKEN(Equal)) -CARBON_PARSE_NODE_KIND_BRACKET(VariableDeclaration, VariableIntroducer, +CARBON_PARSE_NODE_KIND_BRACKET(VariableDecl, VariableIntroducer, CARBON_TOKEN(Semi) CARBON_IF_ERROR(CARBON_TOKEN(Var))) @@ -280,7 +280,7 @@ CARBON_PARSE_NODE_KIND_BRACKET(ReturnStatement, ReturnStatementStart, // _external_: CodeBlock // ForStatement // -// Versus a normal `var`, ForIn replaces VariableDeclaration. +// Versus a normal `var`, ForIn replaces VariableDecl. CARBON_PARSE_NODE_KIND_CHILD_COUNT(ForHeaderStart, 0, CARBON_TOKEN(OpenParen) CARBON_IF_ERROR(CARBON_TOKEN(For))) @@ -369,14 +369,13 @@ CARBON_PARSE_NODE_KIND_BRACKET(CallExpr, CallExprStart, CARBON_TOKEN(CloseParen)) // A qualified declaration, such as `a.b`: -// _external_: Name or QualifiedDeclaration +// _external_: Name or QualifiedDecl // _external_: Name -// QualifiedDeclaration +// QualifiedDecl // // TODO: This will eventually more general expressions, for example with // `GenericType(type_args).ChildType(child_type_args).Name`. -CARBON_PARSE_NODE_KIND_CHILD_COUNT(QualifiedDeclaration, 2, - CARBON_TOKEN(Period)) +CARBON_PARSE_NODE_KIND_CHILD_COUNT(QualifiedDecl, 2, CARBON_TOKEN(Period)) // A member access expression, such as `a.b` or // `GetObject().(Interface.member)`: @@ -527,53 +526,53 @@ CARBON_PARSE_NODE_KIND_BRACKET(StructTypeLiteral, // `class`: // ClassIntroducer -// _external_: Name or QualifiedDeclaration +// _external_: Name or QualifiedDecl // ClassDefinitionStart // _external_: declarations // ClassDefinition // // The above is the structure for a definition; for a declaration, // ClassDefinitionStart and later nodes are removed and replaced by -// ClassDeclaration. +// ClassDecl. CARBON_PARSE_NODE_KIND_CHILD_COUNT(ClassIntroducer, 0, CARBON_TOKEN(Class)) CARBON_PARSE_NODE_KIND_BRACKET(ClassDefinitionStart, ClassIntroducer, CARBON_TOKEN(OpenCurlyBrace)) CARBON_PARSE_NODE_KIND_BRACKET(ClassDefinition, ClassDefinitionStart, CARBON_TOKEN(CloseCurlyBrace)) -CARBON_PARSE_NODE_KIND_BRACKET(ClassDeclaration, ClassIntroducer, +CARBON_PARSE_NODE_KIND_BRACKET(ClassDecl, ClassIntroducer, CARBON_TOKEN(Semi) CARBON_IF_ERROR(CARBON_TOKEN(Class))) // `interface`: // InterfaceIntroducer -// _external_: Name or QualifiedDeclaration +// _external_: Name or QualifiedDecl // InterfaceDefinitionStart // _external_: declarations // InterfaceDefinition // // The above is the structure for a definition; for a declaration, // InterfaceDefinitionStart and later nodes are removed and replaced by -// InterfaceDeclaration. +// InterfaceDecl. CARBON_PARSE_NODE_KIND_CHILD_COUNT(InterfaceIntroducer, 0, CARBON_TOKEN(Interface)) CARBON_PARSE_NODE_KIND_BRACKET(InterfaceDefinitionStart, InterfaceIntroducer, CARBON_TOKEN(OpenCurlyBrace)) CARBON_PARSE_NODE_KIND_BRACKET(InterfaceDefinition, InterfaceDefinitionStart, CARBON_TOKEN(CloseCurlyBrace)) -CARBON_PARSE_NODE_KIND_BRACKET(InterfaceDeclaration, InterfaceIntroducer, +CARBON_PARSE_NODE_KIND_BRACKET(InterfaceDecl, InterfaceIntroducer, CARBON_TOKEN(Semi) CARBON_IF_ERROR(CARBON_TOKEN(Interface))) // `constraint`: // NamedConstraintIntroducer -// _external_: Name or QualifiedDeclaration +// _external_: Name or QualifiedDecl // NamedConstraintDefinitionStart // _external_: declarations // NamedConstraintDefinition // // The above is the structure for a definition; for a declaration, // NamedConstraintDefinitionStart and later nodes are removed and replaced by -// NamedConstraintDeclaration. +// NamedConstraintDecl. CARBON_PARSE_NODE_KIND_CHILD_COUNT(NamedConstraintIntroducer, 0, CARBON_TOKEN(Constraint)) CARBON_PARSE_NODE_KIND_BRACKET(NamedConstraintDefinitionStart, @@ -582,8 +581,8 @@ CARBON_PARSE_NODE_KIND_BRACKET(NamedConstraintDefinitionStart, CARBON_PARSE_NODE_KIND_BRACKET(NamedConstraintDefinition, NamedConstraintDefinitionStart, CARBON_TOKEN(CloseCurlyBrace)) -CARBON_PARSE_NODE_KIND_BRACKET(NamedConstraintDeclaration, - NamedConstraintIntroducer, CARBON_TOKEN(Semi)) +CARBON_PARSE_NODE_KIND_BRACKET(NamedConstraintDecl, NamedConstraintIntroducer, + CARBON_TOKEN(Semi)) // The `self` value and `Self` type identifier keywords. Typically of the form // `self: Self`: diff --git a/toolchain/parse/node_kind.h b/toolchain/parse/node_kind.h index 8c6c5ed5625e..2260e126022c 100644 --- a/toolchain/parse/node_kind.h +++ b/toolchain/parse/node_kind.h @@ -21,7 +21,7 @@ CARBON_DEFINE_RAW_ENUM_CLASS(NodeKind, uint8_t) { // tree. class NodeKind : public CARBON_ENUM_BASE(NodeKind) { public: -#define CARBON_PARSE_NODE_KIND(Name) CARBON_ENUM_CONSTANT_DECLARATION(Name) +#define CARBON_PARSE_NODE_KIND(Name) CARBON_ENUM_CONSTANT_DECL(Name) #include "toolchain/parse/node_kind.def" // Returns true if the node is bracketed; otherwise, child_count is used. diff --git a/toolchain/parse/state.def b/toolchain/parse/state.def index 0425310302fb..39e57fa454b9 100644 --- a/toolchain/parse/state.def +++ b/toolchain/parse/state.def @@ -173,13 +173,13 @@ CARBON_PARSE_STATE(CodeBlockFinish) // - Required: `Foo(...)` or `Foo[...](...)`. // // If `Identifier` followed by `Period`: -// 1. DeclarationNameAndParamsAfterNameAs(None|Optional|Required) +// 1. DeclNameAndParamsAfterNameAs(None|Optional|Required) // If `Identifier`: -// 1. DeclarationNameAndParamsAfterNameAs(None|Optional|Required) -// 2. PeriodAsDeclaration +// 1. DeclNameAndParamsAfterNameAs(None|Optional|Required) +// 2. PeriodAsDecl // Else: // (state done) -CARBON_PARSE_STATE_VARIANTS3(DeclarationNameAndParams, None, Optional, Required) +CARBON_PARSE_STATE_VARIANTS3(DeclNameAndParams, None, Optional, Required) // Handles a declaration name between the main name and implicit parameters. // @@ -187,16 +187,16 @@ CARBON_PARSE_STATE_VARIANTS3(DeclarationNameAndParams, None, Optional, Required) // used. // // If `Period`: -// 1. DeclarationNameAndParamsAfterNameAs(None|Optional|Required) -// 2. PeriodAsDeclaration +// 1. DeclNameAndParamsAfterNameAs(None|Optional|Required) +// 2. PeriodAsDecl // If `OpenSquareBracket`: // 1. ParameterListAsImplicit -// 2. DeclarationNameAndParamsAfterImplicit +// 2. DeclNameAndParamsAfterImplicit // If `OpenParen`: // 1. ParameterListAsRegular // Else: // (state done) -CARBON_PARSE_STATE_VARIANTS3(DeclarationNameAndParamsAfterName, None, Optional, +CARBON_PARSE_STATE_VARIANTS3(DeclNameAndParamsAfterName, None, Optional, Required) // Handles regular parameters such as `(...)` for the general declaration case. @@ -206,37 +206,37 @@ CARBON_PARSE_STATE_VARIANTS3(DeclarationNameAndParamsAfterName, None, Optional, // 1. ParameterListAsRegular // Else: // (state done) -CARBON_PARSE_STATE(DeclarationNameAndParamsAfterImplicit) +CARBON_PARSE_STATE(DeclNameAndParamsAfterImplicit) // Handles processing of a declaration scope. Things like fn, class, interface, // and so on. // // If `Class`: // 1. TypeIntroducerAsClass -// 2. DeclarationScopeLoop +// 2. DeclScopeLoop // If `Constraint`: // 1. TypeIntroducerAsNamedConstraint -// 2. DeclarationScopeLoop +// 2. DeclScopeLoop // If `Fn`: // 1. FunctionIntroducer -// 2. DeclarationScopeLoop +// 2. DeclScopeLoop // If `Interface`: // 1. TypeIntroducerAsInterface -// 2. DeclarationScopeLoop +// 2. DeclScopeLoop // If `Namespace`: // 1. Namespace -// 2. DeclarationScopeLoop +// 2. DeclScopeLoop // If `Semi`: -// 1. DeclarationScopeLoop +// 1. DeclScopeLoop // If `Var`: // 1. VarAsSemicolon -// 2. DeclarationScopeLoop +// 2. DeclScopeLoop // If `Let`: // 1. Let -// 2. DeclarationScopeLoop +// 2. DeclScopeLoop // Else: // (state done) -CARBON_PARSE_STATE(DeclarationScopeLoop) +CARBON_PARSE_STATE(DeclScopeLoop) // Handles periods. Only does one `.` segment; the source is // responsible for handling chaining. @@ -251,7 +251,7 @@ CARBON_PARSE_STATE(DeclarationScopeLoop) // // Always: // (state done) -CARBON_PARSE_STATE_VARIANTS3(Period, Declaration, Expr, Struct) +CARBON_PARSE_STATE_VARIANTS3(Period, Decl, Expr, Struct) // Handles `->name` expressions. Identical to PeriodAsExpr except for the // leading token. @@ -379,7 +379,7 @@ CARBON_PARSE_STATE(ExprStatementFinish) // If invalid: // (state done) // Else: -// 1. DeclarationNameAndParamsAsRequired +// 1. DeclNameAndParamsAsRequired // 2. FunctionAfterParameters CARBON_PARSE_STATE(FunctionIntroducer) @@ -428,7 +428,7 @@ CARBON_PARSE_STATE(Import) // Handles `namespace`. // // Always: -// 1. DeclarationNameAndParamsAsNone +// 1. DeclNameAndParamsAsNone // 2. NamespaceFinish CARBON_PARSE_STATE(Namespace) @@ -710,7 +710,7 @@ CARBON_PARSE_STATE_VARIANTS3(TypeDefinitionFinish, Class, Interface, // Handles processing of a type's introducer. // // Always: -// 1. DeclarationNameAndParamsAsOptional +// 1. DeclNameAndParamsAsOptional // 2. TypeAfterParamsAs(Class|Interface|NamedConstraint) CARBON_PARSE_STATE_VARIANTS3(TypeIntroducer, Class, Interface, NamedConstraint) @@ -719,7 +719,7 @@ CARBON_PARSE_STATE_VARIANTS3(TypeIntroducer, Class, Interface, NamedConstraint) // If `Semi`: // (state done) // If `OpenCurlyBrace`: -// 1. DeclarationScopeLoop +// 1. DeclScopeLoop // 2. TypeDefinitionFinishAs(Class|Interface|NamedConstraint) // Else: // (state done) diff --git a/toolchain/parse/state.h b/toolchain/parse/state.h index c839249da26b..aefd94762c25 100644 --- a/toolchain/parse/state.h +++ b/toolchain/parse/state.h @@ -18,7 +18,7 @@ CARBON_DEFINE_RAW_ENUM_CLASS(State, uint8_t) { class State : public CARBON_ENUM_BASE(State) { public: -#define CARBON_PARSE_STATE(Name) CARBON_ENUM_CONSTANT_DECLARATION(Name) +#define CARBON_PARSE_STATE(Name) CARBON_ENUM_CONSTANT_DECL(Name) #include "toolchain/parse/state.def" }; diff --git a/toolchain/parse/testdata/array/fail_require_close_bracket.carbon b/toolchain/parse/testdata/array/fail_require_close_bracket.carbon index 555fdf259262..bf8bfe046c41 100644 --- a/toolchain/parse/testdata/array/fail_require_close_bracket.carbon +++ b/toolchain/parse/testdata/array/fail_require_close_bracket.carbon @@ -30,6 +30,6 @@ var x: [i32;; // CHECK:STDOUT: {kind: 'InvalidParse', text: ';', has_error: yes}, // CHECK:STDOUT: {kind: 'ArrayExpr', text: ']', has_error: yes, subtree_size: 5}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 7}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: 'var', has_error: yes, subtree_size: 9}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: 'var', has_error: yes, subtree_size: 9}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/array/fail_require_semi.carbon b/toolchain/parse/testdata/array/fail_require_semi.carbon index a380d1614c1e..3be8e60f879d 100644 --- a/toolchain/parse/testdata/array/fail_require_semi.carbon +++ b/toolchain/parse/testdata/array/fail_require_semi.carbon @@ -19,6 +19,6 @@ var x: [i32]; // CHECK:STDOUT: {kind: 'ArrayExprSemi', text: ']', has_error: yes, subtree_size: 3}, // CHECK:STDOUT: {kind: 'ArrayExpr', text: ']', has_error: yes, subtree_size: 4}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 6}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 8}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 8}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/array/with_length.carbon b/toolchain/parse/testdata/array/with_length.carbon index 40cf0479e554..86cbf86f0a8a 100644 --- a/toolchain/parse/testdata/array/with_length.carbon +++ b/toolchain/parse/testdata/array/with_length.carbon @@ -17,6 +17,6 @@ var x: [i32; 10]; // CHECK:STDOUT: {kind: 'Literal', text: '10'}, // CHECK:STDOUT: {kind: 'ArrayExpr', text: ']', subtree_size: 5}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 7}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 9}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 9}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/array/without_length.carbon b/toolchain/parse/testdata/array/without_length.carbon index 52dfe01fafe1..a7d41bffec38 100644 --- a/toolchain/parse/testdata/array/without_length.carbon +++ b/toolchain/parse/testdata/array/without_length.carbon @@ -16,6 +16,6 @@ var x: [i32;]; // CHECK:STDOUT: {kind: 'ArrayExprSemi', text: ';', subtree_size: 3}, // CHECK:STDOUT: {kind: 'ArrayExpr', text: ']', subtree_size: 4}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 6}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 8}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 8}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/basics/builtin_types.carbon b/toolchain/parse/testdata/basics/builtin_types.carbon index 9b53a5b7e12d..2226edea7fff 100644 --- a/toolchain/parse/testdata/basics/builtin_types.carbon +++ b/toolchain/parse/testdata/basics/builtin_types.carbon @@ -17,20 +17,20 @@ var test_str: String = "Test"; // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'Literal', text: '0'}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 7}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 7}, // CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'}, // CHECK:STDOUT: {kind: 'Name', text: 'test_f64'}, // CHECK:STDOUT: {kind: 'Literal', text: 'f64'}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'Literal', text: '0.1'}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 7}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 7}, // CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'}, // CHECK:STDOUT: {kind: 'Name', text: 'test_str'}, // CHECK:STDOUT: {kind: 'Literal', text: 'String'}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'Literal', text: '"Test"'}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 7}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 7}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/basics/empty_declaration.carbon b/toolchain/parse/testdata/basics/empty_declaration.carbon index 74688e76a16d..0c194b49f644 100644 --- a/toolchain/parse/testdata/basics/empty_declaration.carbon +++ b/toolchain/parse/testdata/basics/empty_declaration.carbon @@ -9,6 +9,6 @@ // CHECK:STDOUT: - filename: empty_declaration.carbon // CHECK:STDOUT: parse_tree: [ // CHECK:STDOUT: {kind: 'FileStart', text: ''}, -// CHECK:STDOUT: {kind: 'EmptyDeclaration', text: ';'}, +// CHECK:STDOUT: {kind: 'EmptyDecl', text: ';'}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/basics/fail_no_intro_with_semi.carbon b/toolchain/parse/testdata/basics/fail_no_intro_with_semi.carbon index 130e75e553cb..0f9f2815b7c8 100644 --- a/toolchain/parse/testdata/basics/fail_no_intro_with_semi.carbon +++ b/toolchain/parse/testdata/basics/fail_no_intro_with_semi.carbon @@ -12,6 +12,6 @@ foo; // CHECK:STDOUT: - filename: fail_no_intro_with_semi.carbon // CHECK:STDOUT: parse_tree: [ // CHECK:STDOUT: {kind: 'FileStart', text: ''}, -// CHECK:STDOUT: {kind: 'EmptyDeclaration', text: ';', has_error: yes}, +// CHECK:STDOUT: {kind: 'EmptyDecl', text: ';', has_error: yes}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/basics/fail_no_intro_without_semi.carbon b/toolchain/parse/testdata/basics/fail_no_intro_without_semi.carbon index aac5cdbcf42e..ca11c7cc5788 100644 --- a/toolchain/parse/testdata/basics/fail_no_intro_without_semi.carbon +++ b/toolchain/parse/testdata/basics/fail_no_intro_without_semi.carbon @@ -12,6 +12,6 @@ foo bar baz // CHECK:STDOUT: - filename: fail_no_intro_without_semi.carbon // CHECK:STDOUT: parse_tree: [ // CHECK:STDOUT: {kind: 'FileStart', text: ''}, -// CHECK:STDOUT: {kind: 'EmptyDeclaration', text: 'foo', has_error: yes}, +// CHECK:STDOUT: {kind: 'EmptyDecl', text: 'foo', has_error: yes}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/basics/fail_paren_match_regression.carbon b/toolchain/parse/testdata/basics/fail_paren_match_regression.carbon index 57dccbb4818c..04c9bc571c15 100644 --- a/toolchain/parse/testdata/basics/fail_paren_match_regression.carbon +++ b/toolchain/parse/testdata/basics/fail_paren_match_regression.carbon @@ -26,6 +26,6 @@ var = (foo {}) // CHECK:STDOUT: {kind: 'ParenExprOrTupleLiteralStart', text: '('}, // CHECK:STDOUT: {kind: 'NameExpr', text: 'foo'}, // CHECK:STDOUT: {kind: 'ParenExpr', text: ')', has_error: yes, subtree_size: 3}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: 'var', has_error: yes, subtree_size: 9}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: 'var', has_error: yes, subtree_size: 9}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/basics/numeric_literals.carbon b/toolchain/parse/testdata/basics/numeric_literals.carbon index 03319b011155..53db537b093a 100644 --- a/toolchain/parse/testdata/basics/numeric_literals.carbon +++ b/toolchain/parse/testdata/basics/numeric_literals.carbon @@ -54,7 +54,7 @@ fn F() { // CHECK:STDOUT: {kind: 'Literal', text: '39999999999999999993'}, // CHECK:STDOUT: {kind: 'TupleLiteralComma', text: ','}, // CHECK:STDOUT: {kind: 'TupleLiteral', text: ')', subtree_size: 12}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 22}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 22}, // CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'}, // CHECK:STDOUT: {kind: 'Name', text: 'floats'}, // CHECK:STDOUT: {kind: 'ArrayExprStart', text: '['}, @@ -80,7 +80,7 @@ fn F() { // CHECK:STDOUT: {kind: 'Literal', text: '39999999999999999993.0e39999999999999999993'}, // CHECK:STDOUT: {kind: 'TupleLiteralComma', text: ','}, // CHECK:STDOUT: {kind: 'TupleLiteral', text: ')', subtree_size: 16}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 26}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 26}, // CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 54}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/class/basic.carbon b/toolchain/parse/testdata/class/basic.carbon index 0b3de4b836f8..ef60739fe383 100644 --- a/toolchain/parse/testdata/class/basic.carbon +++ b/toolchain/parse/testdata/class/basic.carbon @@ -18,7 +18,7 @@ class Foo { // CHECK:STDOUT: {kind: 'Name', text: 'Baz'}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'ClassDefinition', text: '}', subtree_size: 9}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/class/var.carbon b/toolchain/parse/testdata/class/var.carbon index ad61a7e26d17..20db08f3dd3f 100644 --- a/toolchain/parse/testdata/class/var.carbon +++ b/toolchain/parse/testdata/class/var.carbon @@ -18,7 +18,7 @@ class Foo { // CHECK:STDOUT: {kind: 'Name', text: 'x'}, // CHECK:STDOUT: {kind: 'Literal', text: 'i32'}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'ClassDefinition', text: '}', subtree_size: 9}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/function/declaration/addr.carbon b/toolchain/parse/testdata/function/declaration/addr.carbon index c7ddce2df946..c756d4f472c1 100644 --- a/toolchain/parse/testdata/function/declaration/addr.carbon +++ b/toolchain/parse/testdata/function/declaration/addr.carbon @@ -18,6 +18,6 @@ fn foo(addr a: i32*); // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 4}, // CHECK:STDOUT: {kind: 'Address', text: 'addr', subtree_size: 5}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 7}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 10}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 10}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/function/declaration/basic.carbon b/toolchain/parse/testdata/function/declaration/basic.carbon index cd9a75462415..d4fe708af35d 100644 --- a/toolchain/parse/testdata/function/declaration/basic.carbon +++ b/toolchain/parse/testdata/function/declaration/basic.carbon @@ -13,6 +13,6 @@ fn F(); // CHECK:STDOUT: {kind: 'Name', text: 'F'}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/function/declaration/fail_identifier_instead_of_sig.carbon b/toolchain/parse/testdata/function/declaration/fail_identifier_instead_of_sig.carbon index 6bb2f77da740..c241b37817cf 100644 --- a/toolchain/parse/testdata/function/declaration/fail_identifier_instead_of_sig.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_identifier_instead_of_sig.carbon @@ -14,6 +14,6 @@ fn foo bar; // CHECK:STDOUT: {kind: 'FileStart', text: ''}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'Name', text: 'foo'}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', has_error: yes, subtree_size: 3}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', has_error: yes, subtree_size: 3}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/function/declaration/fail_missing_implicit_close.carbon b/toolchain/parse/testdata/function/declaration/fail_missing_implicit_close.carbon index 8e744b36a7d0..076de36f4ed0 100644 --- a/toolchain/parse/testdata/function/declaration/fail_missing_implicit_close.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_missing_implicit_close.carbon @@ -26,6 +26,6 @@ fn Div[(); // CHECK:STDOUT: {kind: 'InvalidParse', text: '(', has_error: yes}, // CHECK:STDOUT: {kind: 'PatternBinding', text: '(', has_error: yes, subtree_size: 3}, // CHECK:STDOUT: {kind: 'ImplicitParameterList', text: ']', has_error: yes, subtree_size: 5}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: 'fn', has_error: yes, subtree_size: 8}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: 'fn', has_error: yes, subtree_size: 8}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/function/declaration/fail_missing_name.carbon b/toolchain/parse/testdata/function/declaration/fail_missing_name.carbon index 7fcb67d2f4df..2f7b8907eeae 100644 --- a/toolchain/parse/testdata/function/declaration/fail_missing_name.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_missing_name.carbon @@ -14,6 +14,6 @@ fn (); // CHECK:STDOUT: {kind: 'FileStart', text: ''}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'InvalidParse', text: '(', has_error: yes}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', has_error: yes, subtree_size: 3}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', has_error: yes, subtree_size: 3}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/function/declaration/fail_no_sig_or_semi.carbon b/toolchain/parse/testdata/function/declaration/fail_no_sig_or_semi.carbon index 315bf3e97e7b..7654525feb37 100644 --- a/toolchain/parse/testdata/function/declaration/fail_no_sig_or_semi.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_no_sig_or_semi.carbon @@ -14,6 +14,6 @@ fn foo // CHECK:STDOUT: {kind: 'FileStart', text: ''}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'Name', text: 'foo'}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: 'fn', has_error: yes, subtree_size: 3}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: 'fn', has_error: yes, subtree_size: 3}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/function/declaration/fail_only_fn_and_semi.carbon b/toolchain/parse/testdata/function/declaration/fail_only_fn_and_semi.carbon index 5ef4c23c46d3..18bf799988c9 100644 --- a/toolchain/parse/testdata/function/declaration/fail_only_fn_and_semi.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_only_fn_and_semi.carbon @@ -14,6 +14,6 @@ fn; // CHECK:STDOUT: {kind: 'FileStart', text: ''}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'InvalidParse', text: ';', has_error: yes}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', has_error: yes, subtree_size: 3}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', has_error: yes, subtree_size: 3}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/function/declaration/fail_repeated_fn_and_semi.carbon b/toolchain/parse/testdata/function/declaration/fail_repeated_fn_and_semi.carbon index ed5125359fd7..2151c74fb048 100644 --- a/toolchain/parse/testdata/function/declaration/fail_repeated_fn_and_semi.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_repeated_fn_and_semi.carbon @@ -14,6 +14,6 @@ fn fn; // CHECK:STDOUT: {kind: 'FileStart', text: ''}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'InvalidParse', text: 'fn', has_error: yes}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', has_error: yes, subtree_size: 3}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', has_error: yes, subtree_size: 3}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon b/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon index de7f93babd36..3cc6a1251059 100644 --- a/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon @@ -17,11 +17,11 @@ fn F(); // CHECK:STDOUT: {kind: 'FileStart', text: ''}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'InvalidParse', text: '(', has_error: yes}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: 'fn', has_error: yes, subtree_size: 3}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: 'fn', has_error: yes, subtree_size: 3}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'Name', text: 'F'}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon b/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon index d666535d0434..f459aeba9252 100644 --- a/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon @@ -17,11 +17,11 @@ fn F(); // CHECK:STDOUT: {kind: 'FileStart', text: ''}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'InvalidParse', text: '(', has_error: yes}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', has_error: yes, subtree_size: 3}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', has_error: yes, subtree_size: 3}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'Name', text: 'F'}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon b/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon index cb6b55ba6c80..c43f83d22e54 100644 --- a/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon @@ -17,11 +17,11 @@ fn F(); // CHECK:STDOUT: {kind: 'FileStart', text: ''}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'InvalidParse', text: '(', has_error: yes}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: 'fn', has_error: yes, subtree_size: 3}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: 'fn', has_error: yes, subtree_size: 3}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'Name', text: 'F'}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon b/toolchain/parse/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon index 25606bc0f8bf..45b6a44ebefc 100644 --- a/toolchain/parse/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon @@ -15,11 +15,11 @@ fn F(); // CHECK:STDOUT: {kind: 'FileStart', text: ''}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'InvalidParse', text: '(', has_error: yes}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: 'fn', has_error: yes, subtree_size: 3}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: 'fn', has_error: yes, subtree_size: 3}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'Name', text: 'F'}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon b/toolchain/parse/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon index 33712921c63a..7d8c4554cd7e 100644 --- a/toolchain/parse/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon @@ -13,11 +13,11 @@ fn F(); // CHECK:STDOUT: - filename: fail_skip_without_semi_to_curly.carbon // CHECK:STDOUT: parse_tree: [ // CHECK:STDOUT: {kind: 'FileStart', text: ''}, -// CHECK:STDOUT: {kind: 'EmptyDeclaration', text: 'struct', has_error: yes}, +// CHECK:STDOUT: {kind: 'EmptyDecl', text: 'struct', has_error: yes}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'Name', text: 'F'}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/function/declaration/fail_with_identifier_as_param.carbon b/toolchain/parse/testdata/function/declaration/fail_with_identifier_as_param.carbon index e602252c3151..0f388f52e1ba 100644 --- a/toolchain/parse/testdata/function/declaration/fail_with_identifier_as_param.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_with_identifier_as_param.carbon @@ -19,6 +19,6 @@ fn foo(bar); // CHECK:STDOUT: {kind: 'InvalidParse', text: ')', has_error: yes}, // CHECK:STDOUT: {kind: 'PatternBinding', text: 'bar', has_error: yes, subtree_size: 3}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', has_error: yes, subtree_size: 5}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 8}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 8}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon b/toolchain/parse/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon index e1febd92c636..57577f0c3e83 100644 --- a/toolchain/parse/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon @@ -14,6 +14,6 @@ fn (a tokens c d e f g h i j k l m n o p q r s t u v w x y z); // CHECK:STDOUT: {kind: 'FileStart', text: ''}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'InvalidParse', text: '(', has_error: yes}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', has_error: yes, subtree_size: 3}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', has_error: yes, subtree_size: 3}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/function/declaration/implicit_empty.carbon b/toolchain/parse/testdata/function/declaration/implicit_empty.carbon index 3137916210b2..51e41e848e6d 100644 --- a/toolchain/parse/testdata/function/declaration/implicit_empty.carbon +++ b/toolchain/parse/testdata/function/declaration/implicit_empty.carbon @@ -15,6 +15,6 @@ fn foo[](); // CHECK:STDOUT: {kind: 'ImplicitParameterList', text: ']', subtree_size: 2}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 7}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 7}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/function/declaration/implicit_params.carbon b/toolchain/parse/testdata/function/declaration/implicit_params.carbon index b81d8af0dc7d..36daace3040f 100644 --- a/toolchain/parse/testdata/function/declaration/implicit_params.carbon +++ b/toolchain/parse/testdata/function/declaration/implicit_params.carbon @@ -22,6 +22,6 @@ fn foo[a: i32, b: i32](); // CHECK:STDOUT: {kind: 'ImplicitParameterList', text: ']', subtree_size: 9}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 14}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 14}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/function/declaration/params.carbon b/toolchain/parse/testdata/function/declaration/params.carbon index b27b8f93162a..0723ae0aa29c 100644 --- a/toolchain/parse/testdata/function/declaration/params.carbon +++ b/toolchain/parse/testdata/function/declaration/params.carbon @@ -20,6 +20,6 @@ fn foo(a: i32, b: i32); // CHECK:STDOUT: {kind: 'Literal', text: 'i32'}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 9}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 12}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 12}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/function/declaration/with_return_type.carbon b/toolchain/parse/testdata/function/declaration/with_return_type.carbon index 371e1a81c723..e752e35b8f92 100644 --- a/toolchain/parse/testdata/function/declaration/with_return_type.carbon +++ b/toolchain/parse/testdata/function/declaration/with_return_type.carbon @@ -15,6 +15,6 @@ fn foo() -> u32; // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2}, // CHECK:STDOUT: {kind: 'Literal', text: 'u32'}, // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 7}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 7}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/generics/deduced_params/empty.carbon b/toolchain/parse/testdata/generics/deduced_params/empty.carbon index 3eee06a8a06a..be6cfc2de7d3 100644 --- a/toolchain/parse/testdata/generics/deduced_params/empty.carbon +++ b/toolchain/parse/testdata/generics/deduced_params/empty.carbon @@ -17,7 +17,7 @@ interface Bar[]() {} // CHECK:STDOUT: {kind: 'ImplicitParameterList', text: ']', subtree_size: 2}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'ClassDeclaration', text: ';', subtree_size: 7}, +// CHECK:STDOUT: {kind: 'ClassDecl', text: ';', subtree_size: 7}, // CHECK:STDOUT: {kind: 'InterfaceIntroducer', text: 'interface'}, // CHECK:STDOUT: {kind: 'Name', text: 'Bar'}, // CHECK:STDOUT: {kind: 'ImplicitParameterListStart', text: '['}, diff --git a/toolchain/parse/testdata/generics/deduced_params/fail_no_parens.carbon b/toolchain/parse/testdata/generics/deduced_params/fail_no_parens.carbon index e2650c2a1c2c..9dd8fa4f408e 100644 --- a/toolchain/parse/testdata/generics/deduced_params/fail_no_parens.carbon +++ b/toolchain/parse/testdata/generics/deduced_params/fail_no_parens.carbon @@ -31,7 +31,7 @@ interface Bar[a: i32] {} // CHECK:STDOUT: {kind: 'Name', text: 'Foo'}, // CHECK:STDOUT: {kind: 'ImplicitParameterListStart', text: '['}, // CHECK:STDOUT: {kind: 'ImplicitParameterList', text: ']', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'ClassDeclaration', text: ';', has_error: yes, subtree_size: 5}, +// CHECK:STDOUT: {kind: 'ClassDecl', text: ';', has_error: yes, subtree_size: 5}, // CHECK:STDOUT: {kind: 'ClassIntroducer', text: 'class'}, // CHECK:STDOUT: {kind: 'Name', text: 'Foo'}, // CHECK:STDOUT: {kind: 'ImplicitParameterListStart', text: '['}, @@ -39,12 +39,12 @@ interface Bar[a: i32] {} // CHECK:STDOUT: {kind: 'Literal', text: 'i32'}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, // CHECK:STDOUT: {kind: 'ImplicitParameterList', text: ']', subtree_size: 5}, -// CHECK:STDOUT: {kind: 'ClassDeclaration', text: ';', has_error: yes, subtree_size: 8}, +// CHECK:STDOUT: {kind: 'ClassDecl', text: ';', has_error: yes, subtree_size: 8}, // CHECK:STDOUT: {kind: 'InterfaceIntroducer', text: 'interface'}, // CHECK:STDOUT: {kind: 'Name', text: 'Bar'}, // CHECK:STDOUT: {kind: 'ImplicitParameterListStart', text: '['}, // CHECK:STDOUT: {kind: 'ImplicitParameterList', text: ']', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'InterfaceDeclaration', text: 'interface', has_error: yes, subtree_size: 5}, +// CHECK:STDOUT: {kind: 'InterfaceDecl', text: 'interface', has_error: yes, subtree_size: 5}, // CHECK:STDOUT: {kind: 'InterfaceIntroducer', text: 'interface'}, // CHECK:STDOUT: {kind: 'Name', text: 'Bar'}, // CHECK:STDOUT: {kind: 'ImplicitParameterListStart', text: '['}, @@ -52,6 +52,6 @@ interface Bar[a: i32] {} // CHECK:STDOUT: {kind: 'Literal', text: 'i32'}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, // CHECK:STDOUT: {kind: 'ImplicitParameterList', text: ']', subtree_size: 5}, -// CHECK:STDOUT: {kind: 'InterfaceDeclaration', text: 'interface', has_error: yes, subtree_size: 8}, +// CHECK:STDOUT: {kind: 'InterfaceDecl', text: 'interface', has_error: yes, subtree_size: 8}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/generics/deduced_params/one.carbon b/toolchain/parse/testdata/generics/deduced_params/one.carbon index fa80864bb39d..a76280db3e07 100644 --- a/toolchain/parse/testdata/generics/deduced_params/one.carbon +++ b/toolchain/parse/testdata/generics/deduced_params/one.carbon @@ -20,7 +20,7 @@ interface Bar[a: i32]() {} // CHECK:STDOUT: {kind: 'ImplicitParameterList', text: ']', subtree_size: 5}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'ClassDeclaration', text: ';', subtree_size: 10}, +// CHECK:STDOUT: {kind: 'ClassDecl', text: ';', subtree_size: 10}, // CHECK:STDOUT: {kind: 'InterfaceIntroducer', text: 'interface'}, // CHECK:STDOUT: {kind: 'Name', text: 'Bar'}, // CHECK:STDOUT: {kind: 'ImplicitParameterListStart', text: '['}, diff --git a/toolchain/parse/testdata/generics/deduced_params/one_suffix_comma.carbon b/toolchain/parse/testdata/generics/deduced_params/one_suffix_comma.carbon index 3caaed13a080..7f4e3633ffd6 100644 --- a/toolchain/parse/testdata/generics/deduced_params/one_suffix_comma.carbon +++ b/toolchain/parse/testdata/generics/deduced_params/one_suffix_comma.carbon @@ -21,7 +21,7 @@ interface Bar[a: i32,]() {} // CHECK:STDOUT: {kind: 'ImplicitParameterList', text: ']', subtree_size: 6}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'ClassDeclaration', text: ';', subtree_size: 11}, +// CHECK:STDOUT: {kind: 'ClassDecl', text: ';', subtree_size: 11}, // CHECK:STDOUT: {kind: 'InterfaceIntroducer', text: 'interface'}, // CHECK:STDOUT: {kind: 'Name', text: 'Bar'}, // CHECK:STDOUT: {kind: 'ImplicitParameterListStart', text: '['}, diff --git a/toolchain/parse/testdata/generics/deduced_params/six.carbon b/toolchain/parse/testdata/generics/deduced_params/six.carbon index f5223dd24e90..36299cece390 100644 --- a/toolchain/parse/testdata/generics/deduced_params/six.carbon +++ b/toolchain/parse/testdata/generics/deduced_params/six.carbon @@ -40,7 +40,7 @@ interface Bar[a: i32, b: i32, c: i32, d: i32, e: i32, f: i32]() {} // CHECK:STDOUT: {kind: 'ImplicitParameterList', text: ']', subtree_size: 25}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'ClassDeclaration', text: ';', subtree_size: 30}, +// CHECK:STDOUT: {kind: 'ClassDecl', text: ';', subtree_size: 30}, // CHECK:STDOUT: {kind: 'InterfaceIntroducer', text: 'interface'}, // CHECK:STDOUT: {kind: 'Name', text: 'Bar'}, // CHECK:STDOUT: {kind: 'ImplicitParameterListStart', text: '['}, diff --git a/toolchain/parse/testdata/generics/deduced_params/two.carbon b/toolchain/parse/testdata/generics/deduced_params/two.carbon index 1adc915db9a2..6df6d40c757e 100644 --- a/toolchain/parse/testdata/generics/deduced_params/two.carbon +++ b/toolchain/parse/testdata/generics/deduced_params/two.carbon @@ -24,7 +24,7 @@ interface Bar[a: i32, b: i32]() {} // CHECK:STDOUT: {kind: 'ImplicitParameterList', text: ']', subtree_size: 9}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'ClassDeclaration', text: ';', subtree_size: 14}, +// CHECK:STDOUT: {kind: 'ClassDecl', text: ';', subtree_size: 14}, // CHECK:STDOUT: {kind: 'InterfaceIntroducer', text: 'interface'}, // CHECK:STDOUT: {kind: 'Name', text: 'Bar'}, // CHECK:STDOUT: {kind: 'ImplicitParameterListStart', text: '['}, diff --git a/toolchain/parse/testdata/generics/deduced_params/two_suffix_comma.carbon b/toolchain/parse/testdata/generics/deduced_params/two_suffix_comma.carbon index b188951ca098..dac8131f6db8 100644 --- a/toolchain/parse/testdata/generics/deduced_params/two_suffix_comma.carbon +++ b/toolchain/parse/testdata/generics/deduced_params/two_suffix_comma.carbon @@ -25,7 +25,7 @@ interface Bar[a: i32, b: i32,]() {} // CHECK:STDOUT: {kind: 'ImplicitParameterList', text: ']', subtree_size: 10}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'ClassDeclaration', text: ';', subtree_size: 15}, +// CHECK:STDOUT: {kind: 'ClassDecl', text: ';', subtree_size: 15}, // CHECK:STDOUT: {kind: 'InterfaceIntroducer', text: 'interface'}, // CHECK:STDOUT: {kind: 'Name', text: 'Bar'}, // CHECK:STDOUT: {kind: 'ImplicitParameterListStart', text: '['}, diff --git a/toolchain/parse/testdata/generics/generic_params/basic.carbon b/toolchain/parse/testdata/generics/generic_params/basic.carbon index cba6d89edf90..d60e8b59f7dc 100644 --- a/toolchain/parse/testdata/generics/generic_params/basic.carbon +++ b/toolchain/parse/testdata/generics/generic_params/basic.carbon @@ -16,6 +16,6 @@ fn foo(a:! i32); // CHECK:STDOUT: {kind: 'Literal', text: 'i32'}, // CHECK:STDOUT: {kind: 'GenericPatternBinding', text: ':!', subtree_size: 3}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 5}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 8}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 8}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/generics/generic_params/template.carbon b/toolchain/parse/testdata/generics/generic_params/template.carbon index 2f0d50614ce4..c450a5c12d8d 100644 --- a/toolchain/parse/testdata/generics/generic_params/template.carbon +++ b/toolchain/parse/testdata/generics/generic_params/template.carbon @@ -17,6 +17,6 @@ fn foo(template a:! i32); // CHECK:STDOUT: {kind: 'GenericPatternBinding', text: ':!', subtree_size: 3}, // CHECK:STDOUT: {kind: 'Template', text: 'template', subtree_size: 4}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 6}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 9}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 9}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/generics/generic_params/template_addr.carbon b/toolchain/parse/testdata/generics/generic_params/template_addr.carbon index 67c41159067d..94b3d5d4bfc3 100644 --- a/toolchain/parse/testdata/generics/generic_params/template_addr.carbon +++ b/toolchain/parse/testdata/generics/generic_params/template_addr.carbon @@ -18,6 +18,6 @@ fn foo(template addr a:! i32); // CHECK:STDOUT: {kind: 'Address', text: 'addr', subtree_size: 4}, // CHECK:STDOUT: {kind: 'Template', text: 'template', subtree_size: 5}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 7}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 10}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 10}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/generics/interface/basic.carbon b/toolchain/parse/testdata/generics/interface/basic.carbon index 918cfa4de697..ed983e7ff3ab 100644 --- a/toolchain/parse/testdata/generics/interface/basic.carbon +++ b/toolchain/parse/testdata/generics/interface/basic.carbon @@ -29,7 +29,7 @@ interface Foo { // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 5}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 15}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 15}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'Name', text: 'Add'}, // CHECK:STDOUT: {kind: 'ImplicitParameterListStart', text: '['}, @@ -44,7 +44,7 @@ interface Foo { // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 5}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 15}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 15}, // CHECK:STDOUT: {kind: 'InterfaceDefinition', text: '}', subtree_size: 34}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/generics/interface/fail_missing_name.carbon b/toolchain/parse/testdata/generics/interface/fail_missing_name.carbon index f2af4a7f3270..3e4950761354 100644 --- a/toolchain/parse/testdata/generics/interface/fail_missing_name.carbon +++ b/toolchain/parse/testdata/generics/interface/fail_missing_name.carbon @@ -15,6 +15,6 @@ interface { // CHECK:STDOUT: {kind: 'FileStart', text: ''}, // CHECK:STDOUT: {kind: 'InterfaceIntroducer', text: 'interface'}, // CHECK:STDOUT: {kind: 'InvalidParse', text: '{', has_error: yes}, -// CHECK:STDOUT: {kind: 'InterfaceDeclaration', text: 'interface', has_error: yes, subtree_size: 3}, +// CHECK:STDOUT: {kind: 'InterfaceDecl', text: 'interface', has_error: yes, subtree_size: 3}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/generics/interface/fail_missing_open_curly.carbon b/toolchain/parse/testdata/generics/interface/fail_missing_open_curly.carbon index 00caa8c66d14..017b3c24475d 100644 --- a/toolchain/parse/testdata/generics/interface/fail_missing_open_curly.carbon +++ b/toolchain/parse/testdata/generics/interface/fail_missing_open_curly.carbon @@ -19,9 +19,9 @@ interface Foo // CHECK:STDOUT: {kind: 'FileStart', text: ''}, // CHECK:STDOUT: {kind: 'InterfaceIntroducer', text: 'interface'}, // CHECK:STDOUT: {kind: 'Name', text: 'Bar'}, -// CHECK:STDOUT: {kind: 'InterfaceDeclaration', text: 'interface', has_error: yes, subtree_size: 3}, +// CHECK:STDOUT: {kind: 'InterfaceDecl', text: 'interface', has_error: yes, subtree_size: 3}, // CHECK:STDOUT: {kind: 'InterfaceIntroducer', text: 'interface'}, // CHECK:STDOUT: {kind: 'Name', text: 'Foo'}, -// CHECK:STDOUT: {kind: 'InterfaceDeclaration', text: 'interface', has_error: yes, subtree_size: 3}, +// CHECK:STDOUT: {kind: 'InterfaceDecl', text: 'interface', has_error: yes, subtree_size: 3}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/generics/interface/fail_no_impl_allowed.carbon b/toolchain/parse/testdata/generics/interface/fail_no_impl_allowed.carbon index 6f17bb92fc07..46114823d6cc 100644 --- a/toolchain/parse/testdata/generics/interface/fail_no_impl_allowed.carbon +++ b/toolchain/parse/testdata/generics/interface/fail_no_impl_allowed.carbon @@ -33,7 +33,7 @@ interface Foo { // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 5}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: 'fn', has_error: yes, subtree_size: 15}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: 'fn', has_error: yes, subtree_size: 15}, // CHECK:STDOUT: {kind: 'InterfaceDefinition', text: '}', subtree_size: 19}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/generics/interface/fail_self_param_syntax.carbon b/toolchain/parse/testdata/generics/interface/fail_self_param_syntax.carbon index 8318584f6dfa..2d6243525c85 100644 --- a/toolchain/parse/testdata/generics/interface/fail_self_param_syntax.carbon +++ b/toolchain/parse/testdata/generics/interface/fail_self_param_syntax.carbon @@ -36,7 +36,7 @@ interface Foo { // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 5}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 15}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 15}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'Name', text: 'Mul'}, // CHECK:STDOUT: {kind: 'ImplicitParameterListStart', text: '['}, @@ -51,7 +51,7 @@ interface Foo { // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 5}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 15}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 15}, // CHECK:STDOUT: {kind: 'InterfaceDefinition', text: '}', subtree_size: 34}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/generics/interface/non_instance_fn.carbon b/toolchain/parse/testdata/generics/interface/non_instance_fn.carbon index 123c9bff0ca4..1471ef0dc8bb 100644 --- a/toolchain/parse/testdata/generics/interface/non_instance_fn.carbon +++ b/toolchain/parse/testdata/generics/interface/non_instance_fn.carbon @@ -20,7 +20,7 @@ interface Foo { // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 7}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 7}, // CHECK:STDOUT: {kind: 'InterfaceDefinition', text: '}', subtree_size: 11}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/generics/interface/self_pointer.carbon b/toolchain/parse/testdata/generics/interface/self_pointer.carbon index 2e25caff7f5e..332b132a4418 100644 --- a/toolchain/parse/testdata/generics/interface/self_pointer.carbon +++ b/toolchain/parse/testdata/generics/interface/self_pointer.carbon @@ -31,7 +31,7 @@ interface Foo { // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 5}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 17}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 17}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'Name', text: 'Sub'}, // CHECK:STDOUT: {kind: 'ImplicitParameterListStart', text: '['}, @@ -48,7 +48,7 @@ interface Foo { // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 5}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 17}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 17}, // CHECK:STDOUT: {kind: 'InterfaceDefinition', text: '}', subtree_size: 38}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/generics/named_constraint/basic.carbon b/toolchain/parse/testdata/generics/named_constraint/basic.carbon index adb2ef1ee930..6da39cb17bbd 100644 --- a/toolchain/parse/testdata/generics/named_constraint/basic.carbon +++ b/toolchain/parse/testdata/generics/named_constraint/basic.carbon @@ -18,7 +18,7 @@ constraint Foo { // CHECK:STDOUT: {kind: 'Name', text: 'Baz'}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'NamedConstraintDefinition', text: '}', subtree_size: 9}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/generics/named_constraint/fail_no_impl_allowed.carbon b/toolchain/parse/testdata/generics/named_constraint/fail_no_impl_allowed.carbon index 0be93c4d5a22..c7551b6dd9cb 100644 --- a/toolchain/parse/testdata/generics/named_constraint/fail_no_impl_allowed.carbon +++ b/toolchain/parse/testdata/generics/named_constraint/fail_no_impl_allowed.carbon @@ -31,7 +31,7 @@ constraint Foo { // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 5}, // CHECK:STDOUT: {kind: 'SelfTypeNameExpr', text: 'Self'}, // CHECK:STDOUT: {kind: 'ReturnType', text: '->', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: 'fn', has_error: yes, subtree_size: 15}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: 'fn', has_error: yes, subtree_size: 15}, // CHECK:STDOUT: {kind: 'NamedConstraintDefinition', text: '}', subtree_size: 19}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/generics/params/empty.carbon b/toolchain/parse/testdata/generics/params/empty.carbon index cb9eacea43ae..4e644a9facfe 100644 --- a/toolchain/parse/testdata/generics/params/empty.carbon +++ b/toolchain/parse/testdata/generics/params/empty.carbon @@ -15,7 +15,7 @@ interface Bar() {} // CHECK:STDOUT: {kind: 'Name', text: 'Foo'}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'ClassDeclaration', text: ';', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'ClassDecl', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'InterfaceIntroducer', text: 'interface'}, // CHECK:STDOUT: {kind: 'Name', text: 'Bar'}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, diff --git a/toolchain/parse/testdata/generics/params/one.carbon b/toolchain/parse/testdata/generics/params/one.carbon index 63a5c0058b0d..0bc7fd3961ed 100644 --- a/toolchain/parse/testdata/generics/params/one.carbon +++ b/toolchain/parse/testdata/generics/params/one.carbon @@ -18,7 +18,7 @@ interface Bar(a: i32) {} // CHECK:STDOUT: {kind: 'Literal', text: 'i32'}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 5}, -// CHECK:STDOUT: {kind: 'ClassDeclaration', text: ';', subtree_size: 8}, +// CHECK:STDOUT: {kind: 'ClassDecl', text: ';', subtree_size: 8}, // CHECK:STDOUT: {kind: 'InterfaceIntroducer', text: 'interface'}, // CHECK:STDOUT: {kind: 'Name', text: 'Bar'}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, diff --git a/toolchain/parse/testdata/generics/params/one_suffix_comma.carbon b/toolchain/parse/testdata/generics/params/one_suffix_comma.carbon index da725912cd91..d7afc67afa36 100644 --- a/toolchain/parse/testdata/generics/params/one_suffix_comma.carbon +++ b/toolchain/parse/testdata/generics/params/one_suffix_comma.carbon @@ -19,7 +19,7 @@ interface Bar(a: i32,) {} // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, // CHECK:STDOUT: {kind: 'ParameterListComma', text: ','}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 6}, -// CHECK:STDOUT: {kind: 'ClassDeclaration', text: ';', subtree_size: 9}, +// CHECK:STDOUT: {kind: 'ClassDecl', text: ';', subtree_size: 9}, // CHECK:STDOUT: {kind: 'InterfaceIntroducer', text: 'interface'}, // CHECK:STDOUT: {kind: 'Name', text: 'Bar'}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, diff --git a/toolchain/parse/testdata/generics/params/six.carbon b/toolchain/parse/testdata/generics/params/six.carbon index 8b9c89611692..3f4774c68cd5 100644 --- a/toolchain/parse/testdata/generics/params/six.carbon +++ b/toolchain/parse/testdata/generics/params/six.carbon @@ -38,7 +38,7 @@ interface Bar(a: i32, b: i32, c: i32, d: i32, e: i32, f: i32) {} // CHECK:STDOUT: {kind: 'Literal', text: 'i32'}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 25}, -// CHECK:STDOUT: {kind: 'ClassDeclaration', text: ';', subtree_size: 28}, +// CHECK:STDOUT: {kind: 'ClassDecl', text: ';', subtree_size: 28}, // CHECK:STDOUT: {kind: 'InterfaceIntroducer', text: 'interface'}, // CHECK:STDOUT: {kind: 'Name', text: 'Bar'}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, diff --git a/toolchain/parse/testdata/generics/params/two.carbon b/toolchain/parse/testdata/generics/params/two.carbon index 9b5964a4b3e4..7a33ccb99da6 100644 --- a/toolchain/parse/testdata/generics/params/two.carbon +++ b/toolchain/parse/testdata/generics/params/two.carbon @@ -22,7 +22,7 @@ interface Bar(a: i32, b: i32) {} // CHECK:STDOUT: {kind: 'Literal', text: 'i32'}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 9}, -// CHECK:STDOUT: {kind: 'ClassDeclaration', text: ';', subtree_size: 12}, +// CHECK:STDOUT: {kind: 'ClassDecl', text: ';', subtree_size: 12}, // CHECK:STDOUT: {kind: 'InterfaceIntroducer', text: 'interface'}, // CHECK:STDOUT: {kind: 'Name', text: 'Bar'}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, diff --git a/toolchain/parse/testdata/generics/params/two_suffix_comma.carbon b/toolchain/parse/testdata/generics/params/two_suffix_comma.carbon index e81fcff6bdb3..dadc1d4cb78f 100644 --- a/toolchain/parse/testdata/generics/params/two_suffix_comma.carbon +++ b/toolchain/parse/testdata/generics/params/two_suffix_comma.carbon @@ -23,7 +23,7 @@ interface Bar(a: i32, b: i32,) {} // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, // CHECK:STDOUT: {kind: 'ParameterListComma', text: ','}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 10}, -// CHECK:STDOUT: {kind: 'ClassDeclaration', text: ';', subtree_size: 13}, +// CHECK:STDOUT: {kind: 'ClassDecl', text: ';', subtree_size: 13}, // CHECK:STDOUT: {kind: 'InterfaceIntroducer', text: 'interface'}, // CHECK:STDOUT: {kind: 'Name', text: 'Bar'}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, diff --git a/toolchain/parse/testdata/if_expression/fail_condition_missing.carbon b/toolchain/parse/testdata/if_expression/fail_condition_missing.carbon index 0ae9ba8c382a..23dd88baf337 100644 --- a/toolchain/parse/testdata/if_expression/fail_condition_missing.carbon +++ b/toolchain/parse/testdata/if_expression/fail_condition_missing.carbon @@ -29,7 +29,7 @@ fn F() { // CHECK:STDOUT: {kind: 'InvalidParse', text: ';', has_error: yes}, // CHECK:STDOUT: {kind: 'InvalidParse', text: ';', has_error: yes}, // CHECK:STDOUT: {kind: 'IfExprElse', text: 'if', has_error: yes, subtree_size: 5}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 11}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 11}, // CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 17}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/if_expression/fail_else_expr_missing.carbon b/toolchain/parse/testdata/if_expression/fail_else_expr_missing.carbon index 0dff0ec37d07..cff583dc4198 100644 --- a/toolchain/parse/testdata/if_expression/fail_else_expr_missing.carbon +++ b/toolchain/parse/testdata/if_expression/fail_else_expr_missing.carbon @@ -30,7 +30,7 @@ fn F() { // CHECK:STDOUT: {kind: 'IfExprThen', text: 'then', subtree_size: 2}, // CHECK:STDOUT: {kind: 'InvalidParse', text: ';', has_error: yes}, // CHECK:STDOUT: {kind: 'IfExprElse', text: 'else', has_error: yes, subtree_size: 6}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 12}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 12}, // CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 18}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/if_expression/fail_else_missing.carbon b/toolchain/parse/testdata/if_expression/fail_else_missing.carbon index 2b961281b43b..3a368321f0d0 100644 --- a/toolchain/parse/testdata/if_expression/fail_else_missing.carbon +++ b/toolchain/parse/testdata/if_expression/fail_else_missing.carbon @@ -30,7 +30,7 @@ fn F() { // CHECK:STDOUT: {kind: 'IfExprThen', text: 'then', subtree_size: 2}, // CHECK:STDOUT: {kind: 'InvalidParse', text: ';', has_error: yes}, // CHECK:STDOUT: {kind: 'IfExprElse', text: 'if', has_error: yes, subtree_size: 6}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 12}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 12}, // CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 18}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/if_expression/fail_then_expr_missing.carbon b/toolchain/parse/testdata/if_expression/fail_then_expr_missing.carbon index f96a6b6f6b47..f37b8289fbdb 100644 --- a/toolchain/parse/testdata/if_expression/fail_then_expr_missing.carbon +++ b/toolchain/parse/testdata/if_expression/fail_then_expr_missing.carbon @@ -30,7 +30,7 @@ fn F() { // CHECK:STDOUT: {kind: 'IfExprThen', text: 'then', has_error: yes, subtree_size: 2}, // CHECK:STDOUT: {kind: 'InvalidParse', text: ';', has_error: yes}, // CHECK:STDOUT: {kind: 'IfExprElse', text: 'if', has_error: yes, subtree_size: 6}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 12}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 12}, // CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 18}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/if_expression/fail_then_missing.carbon b/toolchain/parse/testdata/if_expression/fail_then_missing.carbon index 1e4820a0a3a3..ea670183549e 100644 --- a/toolchain/parse/testdata/if_expression/fail_then_missing.carbon +++ b/toolchain/parse/testdata/if_expression/fail_then_missing.carbon @@ -29,7 +29,7 @@ fn F() { // CHECK:STDOUT: {kind: 'InvalidParse', text: ';', has_error: yes}, // CHECK:STDOUT: {kind: 'InvalidParse', text: ';', has_error: yes}, // CHECK:STDOUT: {kind: 'IfExprElse', text: 'if', has_error: yes, subtree_size: 5}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 11}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 11}, // CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 17}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/if_expression/in_type.carbon b/toolchain/parse/testdata/if_expression/in_type.carbon index 7d74a493f56f..11ade79d6b69 100644 --- a/toolchain/parse/testdata/if_expression/in_type.carbon +++ b/toolchain/parse/testdata/if_expression/in_type.carbon @@ -17,7 +17,7 @@ fn F() -> if true then i32 else i32* { // CHECK:STDOUT: {kind: 'Name', text: 'n'}, // CHECK:STDOUT: {kind: 'Literal', text: 'i32'}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'Name', text: 'F'}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, diff --git a/toolchain/parse/testdata/index/assign_to_var.carbon b/toolchain/parse/testdata/index/assign_to_var.carbon index 17d122d5eff8..d39d77c46536 100644 --- a/toolchain/parse/testdata/index/assign_to_var.carbon +++ b/toolchain/parse/testdata/index/assign_to_var.carbon @@ -18,6 +18,6 @@ var v: i32 = t[0]; // CHECK:STDOUT: {kind: 'IndexExprStart', text: '[', subtree_size: 2}, // CHECK:STDOUT: {kind: 'Literal', text: '0'}, // CHECK:STDOUT: {kind: 'IndexExpr', text: ']', subtree_size: 4}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 10}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 10}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/index/fail_empty_expr.carbon b/toolchain/parse/testdata/index/fail_empty_expr.carbon index cee3792a82cb..ec809a72c6d4 100644 --- a/toolchain/parse/testdata/index/fail_empty_expr.carbon +++ b/toolchain/parse/testdata/index/fail_empty_expr.carbon @@ -21,6 +21,6 @@ var v: i32 = t[]; // CHECK:STDOUT: {kind: 'IndexExprStart', text: '[', subtree_size: 2}, // CHECK:STDOUT: {kind: 'InvalidParse', text: ']', has_error: yes}, // CHECK:STDOUT: {kind: 'IndexExpr', text: ']', has_error: yes, subtree_size: 4}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 10}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 10}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/index/fail_malformed_expr.carbon b/toolchain/parse/testdata/index/fail_malformed_expr.carbon index 479612977c07..a235b913d1aa 100644 --- a/toolchain/parse/testdata/index/fail_malformed_expr.carbon +++ b/toolchain/parse/testdata/index/fail_malformed_expr.carbon @@ -21,6 +21,6 @@ var v: i32 = t[0,]; // CHECK:STDOUT: {kind: 'IndexExprStart', text: '[', subtree_size: 2}, // CHECK:STDOUT: {kind: 'Literal', text: '0'}, // CHECK:STDOUT: {kind: 'IndexExpr', text: ']', has_error: yes, subtree_size: 4}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 10}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 10}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/let/fail_bad_name.carbon b/toolchain/parse/testdata/let/fail_bad_name.carbon index afa9b09707b9..07995a18ec74 100644 --- a/toolchain/parse/testdata/let/fail_bad_name.carbon +++ b/toolchain/parse/testdata/let/fail_bad_name.carbon @@ -18,6 +18,6 @@ let ? = 4; // CHECK:STDOUT: {kind: 'PatternBinding', text: '?', has_error: yes, subtree_size: 3}, // CHECK:STDOUT: {kind: 'LetInitializer', text: '='}, // CHECK:STDOUT: {kind: 'Literal', text: '4'}, -// CHECK:STDOUT: {kind: 'LetDeclaration', text: ';', subtree_size: 7}, +// CHECK:STDOUT: {kind: 'LetDecl', text: ';', subtree_size: 7}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/let/fail_empty.carbon b/toolchain/parse/testdata/let/fail_empty.carbon index faf53472526c..a5ecd1dc62fe 100644 --- a/toolchain/parse/testdata/let/fail_empty.carbon +++ b/toolchain/parse/testdata/let/fail_empty.carbon @@ -16,6 +16,6 @@ let; // CHECK:STDOUT: {kind: 'Name', text: ';', has_error: yes}, // CHECK:STDOUT: {kind: 'InvalidParse', text: ';', has_error: yes}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ';', has_error: yes, subtree_size: 3}, -// CHECK:STDOUT: {kind: 'LetDeclaration', text: ';', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'LetDecl', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/let/fail_missing_type.carbon b/toolchain/parse/testdata/let/fail_missing_type.carbon index 067391e17b6c..afc1ec25ad7e 100644 --- a/toolchain/parse/testdata/let/fail_missing_type.carbon +++ b/toolchain/parse/testdata/let/fail_missing_type.carbon @@ -18,6 +18,6 @@ let a = 4; // CHECK:STDOUT: {kind: 'PatternBinding', text: 'a', has_error: yes, subtree_size: 3}, // CHECK:STDOUT: {kind: 'LetInitializer', text: '='}, // CHECK:STDOUT: {kind: 'Literal', text: '4'}, -// CHECK:STDOUT: {kind: 'LetDeclaration', text: ';', subtree_size: 7}, +// CHECK:STDOUT: {kind: 'LetDecl', text: ';', subtree_size: 7}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/let/fail_missing_value.carbon b/toolchain/parse/testdata/let/fail_missing_value.carbon index 49d292eec0af..c655807fbec1 100644 --- a/toolchain/parse/testdata/let/fail_missing_value.carbon +++ b/toolchain/parse/testdata/let/fail_missing_value.carbon @@ -23,7 +23,7 @@ fn F() { // CHECK:STDOUT: {kind: 'Name', text: 'a'}, // CHECK:STDOUT: {kind: 'Literal', text: 'i32'}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'LetDeclaration', text: ';', has_error: yes, subtree_size: 5}, +// CHECK:STDOUT: {kind: 'LetDecl', text: ';', has_error: yes, subtree_size: 5}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'Name', text: 'F'}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, @@ -33,7 +33,7 @@ fn F() { // CHECK:STDOUT: {kind: 'Name', text: 'b'}, // CHECK:STDOUT: {kind: 'Literal', text: 'i32'}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'LetDeclaration', text: ';', has_error: yes, subtree_size: 5}, +// CHECK:STDOUT: {kind: 'LetDecl', text: ';', has_error: yes, subtree_size: 5}, // CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 11}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/let/fail_no_semi.carbon b/toolchain/parse/testdata/let/fail_no_semi.carbon index 0f2c842813c1..03530b9016bf 100644 --- a/toolchain/parse/testdata/let/fail_no_semi.carbon +++ b/toolchain/parse/testdata/let/fail_no_semi.carbon @@ -19,6 +19,6 @@ let // CHECK:STDOUT: {kind: 'Name', text: '', has_error: yes}, // CHECK:STDOUT: {kind: 'InvalidParse', text: '', has_error: yes}, // CHECK:STDOUT: {kind: 'PatternBinding', text: '', has_error: yes, subtree_size: 3}, -// CHECK:STDOUT: {kind: 'LetDeclaration', text: 'let', has_error: yes, subtree_size: 5}, +// CHECK:STDOUT: {kind: 'LetDecl', text: 'let', has_error: yes, subtree_size: 5}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/let/let.carbon b/toolchain/parse/testdata/let/let.carbon index 390124861b9d..afffd80273be 100644 --- a/toolchain/parse/testdata/let/let.carbon +++ b/toolchain/parse/testdata/let/let.carbon @@ -18,7 +18,7 @@ fn F() { // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, // CHECK:STDOUT: {kind: 'LetInitializer', text: '='}, // CHECK:STDOUT: {kind: 'Literal', text: '0'}, -// CHECK:STDOUT: {kind: 'LetDeclaration', text: ';', subtree_size: 7}, +// CHECK:STDOUT: {kind: 'LetDecl', text: ';', subtree_size: 7}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'Name', text: 'F'}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, @@ -30,7 +30,7 @@ fn F() { // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, // CHECK:STDOUT: {kind: 'LetInitializer', text: '='}, // CHECK:STDOUT: {kind: 'Literal', text: '"hello"'}, -// CHECK:STDOUT: {kind: 'LetDeclaration', text: ';', subtree_size: 7}, +// CHECK:STDOUT: {kind: 'LetDecl', text: ';', subtree_size: 7}, // CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 13}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/namespace/fail_incomplete_name.carbon b/toolchain/parse/testdata/namespace/fail_incomplete_name.carbon index 71a00394ccec..17023dfbad3d 100644 --- a/toolchain/parse/testdata/namespace/fail_incomplete_name.carbon +++ b/toolchain/parse/testdata/namespace/fail_incomplete_name.carbon @@ -15,7 +15,7 @@ namespace Foo.; // CHECK:STDOUT: {kind: 'NamespaceStart', text: 'namespace'}, // CHECK:STDOUT: {kind: 'Name', text: 'Foo'}, // CHECK:STDOUT: {kind: 'Name', text: ';', has_error: yes}, -// CHECK:STDOUT: {kind: 'QualifiedDeclaration', text: '.', subtree_size: 3}, +// CHECK:STDOUT: {kind: 'QualifiedDecl', text: '.', subtree_size: 3}, // CHECK:STDOUT: {kind: 'Namespace', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/namespace/nested.carbon b/toolchain/parse/testdata/namespace/nested.carbon index 44ec69cb4320..1118f63f2b2c 100644 --- a/toolchain/parse/testdata/namespace/nested.carbon +++ b/toolchain/parse/testdata/namespace/nested.carbon @@ -20,14 +20,14 @@ fn Foo.Bar.Baz() { // CHECK:STDOUT: {kind: 'NamespaceStart', text: 'namespace'}, // CHECK:STDOUT: {kind: 'Name', text: 'Foo'}, // CHECK:STDOUT: {kind: 'Name', text: 'Bar'}, -// CHECK:STDOUT: {kind: 'QualifiedDeclaration', text: '.', subtree_size: 3}, +// CHECK:STDOUT: {kind: 'QualifiedDecl', text: '.', subtree_size: 3}, // CHECK:STDOUT: {kind: 'Namespace', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'Name', text: 'Foo'}, // CHECK:STDOUT: {kind: 'Name', text: 'Bar'}, -// CHECK:STDOUT: {kind: 'QualifiedDeclaration', text: '.', subtree_size: 3}, +// CHECK:STDOUT: {kind: 'QualifiedDecl', text: '.', subtree_size: 3}, // CHECK:STDOUT: {kind: 'Name', text: 'Baz'}, -// CHECK:STDOUT: {kind: 'QualifiedDeclaration', text: '.', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'QualifiedDecl', text: '.', subtree_size: 5}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2}, // CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 9}, diff --git a/toolchain/parse/testdata/operators/assign.carbon b/toolchain/parse/testdata/operators/assign.carbon index 8bbb445fa001..0c80ae020cf9 100644 --- a/toolchain/parse/testdata/operators/assign.carbon +++ b/toolchain/parse/testdata/operators/assign.carbon @@ -36,14 +36,14 @@ fn F() { // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'Literal', text: '0'}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 7}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 7}, // CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'}, // CHECK:STDOUT: {kind: 'Name', text: 'b'}, // CHECK:STDOUT: {kind: 'Literal', text: 'i32'}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'Literal', text: '1'}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 7}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 7}, // CHECK:STDOUT: {kind: 'NameExpr', text: 'a'}, // CHECK:STDOUT: {kind: 'NameExpr', text: 'b'}, // CHECK:STDOUT: {kind: 'InfixOperator', text: '=', subtree_size: 3}, diff --git a/toolchain/parse/testdata/operators/fail_chained_assign.carbon b/toolchain/parse/testdata/operators/fail_chained_assign.carbon index eb9fe99df413..cfbe3cb19fd3 100644 --- a/toolchain/parse/testdata/operators/fail_chained_assign.carbon +++ b/toolchain/parse/testdata/operators/fail_chained_assign.carbon @@ -27,12 +27,12 @@ fn F() { // CHECK:STDOUT: {kind: 'Name', text: 'a'}, // CHECK:STDOUT: {kind: 'Literal', text: 'i32'}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'}, // CHECK:STDOUT: {kind: 'Name', text: 'b'}, // CHECK:STDOUT: {kind: 'Literal', text: 'i32'}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'NameExpr', text: 'a'}, // CHECK:STDOUT: {kind: 'NameExpr', text: 'b'}, // CHECK:STDOUT: {kind: 'InfixOperator', text: '=', subtree_size: 3}, diff --git a/toolchain/parse/testdata/operators/fail_infix_uneven_space_after.carbon b/toolchain/parse/testdata/operators/fail_infix_uneven_space_after.carbon index 363221a8a9e2..aa7738755272 100644 --- a/toolchain/parse/testdata/operators/fail_infix_uneven_space_after.carbon +++ b/toolchain/parse/testdata/operators/fail_infix_uneven_space_after.carbon @@ -21,6 +21,6 @@ var n: i8 = n* n; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'NameExpr', text: 'n'}, // CHECK:STDOUT: {kind: 'PostfixOperator', text: '*', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', has_error: yes, subtree_size: 8}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', has_error: yes, subtree_size: 8}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/operators/fail_invalid_infix.carbon b/toolchain/parse/testdata/operators/fail_invalid_infix.carbon index 7f5fb34968ca..77a9c35de544 100644 --- a/toolchain/parse/testdata/operators/fail_invalid_infix.carbon +++ b/toolchain/parse/testdata/operators/fail_invalid_infix.carbon @@ -31,7 +31,7 @@ var c: i32 = == ; // CHECK:STDOUT: {kind: 'NameExpr', text: 'n'}, // CHECK:STDOUT: {kind: 'InvalidParse', text: ';', has_error: yes}, // CHECK:STDOUT: {kind: 'InfixOperator', text: '==', has_error: yes, subtree_size: 3}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 9}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 9}, // CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'}, // CHECK:STDOUT: {kind: 'Name', text: 'b'}, // CHECK:STDOUT: {kind: 'Literal', text: 'i32'}, @@ -40,7 +40,7 @@ var c: i32 = == ; // CHECK:STDOUT: {kind: 'InvalidParse', text: '==', has_error: yes}, // CHECK:STDOUT: {kind: 'NameExpr', text: 'n'}, // CHECK:STDOUT: {kind: 'InfixOperator', text: '==', has_error: yes, subtree_size: 3}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 9}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 9}, // CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'}, // CHECK:STDOUT: {kind: 'Name', text: 'c'}, // CHECK:STDOUT: {kind: 'Literal', text: 'i32'}, @@ -49,6 +49,6 @@ var c: i32 = == ; // CHECK:STDOUT: {kind: 'InvalidParse', text: '==', has_error: yes}, // CHECK:STDOUT: {kind: 'InvalidParse', text: ';', has_error: yes}, // CHECK:STDOUT: {kind: 'InfixOperator', text: '==', has_error: yes, subtree_size: 3}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 9}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 9}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/operators/fail_postincrement.carbon b/toolchain/parse/testdata/operators/fail_postincrement.carbon index 0362c0659c97..782e96ae3a58 100644 --- a/toolchain/parse/testdata/operators/fail_postincrement.carbon +++ b/toolchain/parse/testdata/operators/fail_postincrement.carbon @@ -31,7 +31,7 @@ fn F() { // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'Literal', text: '0'}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 7}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 7}, // CHECK:STDOUT: {kind: 'NameExpr', text: 'n'}, // CHECK:STDOUT: {kind: 'ExprStatement', text: ';', has_error: yes, subtree_size: 2}, // CHECK:STDOUT: {kind: 'NameExpr', text: 'n'}, diff --git a/toolchain/parse/testdata/operators/fail_precedence_assign.carbon b/toolchain/parse/testdata/operators/fail_precedence_assign.carbon index 84a2aa444df2..9801463b44c1 100644 --- a/toolchain/parse/testdata/operators/fail_precedence_assign.carbon +++ b/toolchain/parse/testdata/operators/fail_precedence_assign.carbon @@ -41,7 +41,7 @@ fn F() { // CHECK:STDOUT: {kind: 'Name', text: 'a'}, // CHECK:STDOUT: {kind: 'Literal', text: 'i32'}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'Literal', text: '1'}, // CHECK:STDOUT: {kind: 'ParenExprOrTupleLiteralStart', text: '('}, // CHECK:STDOUT: {kind: 'NameExpr', text: 'a'}, diff --git a/toolchain/parse/testdata/operators/fail_precedence_star_minus.carbon b/toolchain/parse/testdata/operators/fail_precedence_star_minus.carbon index aeae0e8b3fb1..46447df99691 100644 --- a/toolchain/parse/testdata/operators/fail_precedence_star_minus.carbon +++ b/toolchain/parse/testdata/operators/fail_precedence_star_minus.carbon @@ -21,6 +21,6 @@ var n: i8 = n* -n; // CHECK:STDOUT: {kind: 'PostfixOperator', text: '*', subtree_size: 2}, // CHECK:STDOUT: {kind: 'NameExpr', text: 'n'}, // CHECK:STDOUT: {kind: 'InfixOperator', text: '-', has_error: yes, subtree_size: 4}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 10}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 10}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/operators/fail_precedence_star_star.carbon b/toolchain/parse/testdata/operators/fail_precedence_star_star.carbon index 9c61831c9ec6..82f08ce64c15 100644 --- a/toolchain/parse/testdata/operators/fail_precedence_star_star.carbon +++ b/toolchain/parse/testdata/operators/fail_precedence_star_star.carbon @@ -21,6 +21,6 @@ var n: i8 = n* *p; // CHECK:STDOUT: {kind: 'PostfixOperator', text: '*', subtree_size: 2}, // CHECK:STDOUT: {kind: 'NameExpr', text: 'p'}, // CHECK:STDOUT: {kind: 'InfixOperator', text: '*', has_error: yes, subtree_size: 4}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 10}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 10}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/operators/fail_star_star_no_space.carbon b/toolchain/parse/testdata/operators/fail_star_star_no_space.carbon index 901afd8c420f..d9b7bb29b340 100644 --- a/toolchain/parse/testdata/operators/fail_star_star_no_space.carbon +++ b/toolchain/parse/testdata/operators/fail_star_star_no_space.carbon @@ -24,6 +24,6 @@ var n: i8 = n**p; // CHECK:STDOUT: {kind: 'NameExpr', text: 'n'}, // CHECK:STDOUT: {kind: 'PostfixOperator', text: '*', subtree_size: 2}, // CHECK:STDOUT: {kind: 'PostfixOperator', text: '*', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', has_error: yes, subtree_size: 9}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', has_error: yes, subtree_size: 9}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/operators/fixity_in_var.carbon b/toolchain/parse/testdata/operators/fixity_in_var.carbon index 9c16d8cec9eb..df664fa35f67 100644 --- a/toolchain/parse/testdata/operators/fixity_in_var.carbon +++ b/toolchain/parse/testdata/operators/fixity_in_var.carbon @@ -24,7 +24,7 @@ fn F() { // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 4}, // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'NameExpr', text: 'p'}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 8}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 8}, // CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'}, // CHECK:STDOUT: {kind: 'Name', text: 't'}, // CHECK:STDOUT: {kind: 'Literal', text: 'type'}, @@ -32,7 +32,7 @@ fn F() { // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'Literal', text: 'i32'}, // CHECK:STDOUT: {kind: 'PostfixOperator', text: '*', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 8}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 8}, // CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 22}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/operators/infix.carbon b/toolchain/parse/testdata/operators/infix.carbon index 9b130800bdd4..31c6e74f4475 100644 --- a/toolchain/parse/testdata/operators/infix.carbon +++ b/toolchain/parse/testdata/operators/infix.carbon @@ -17,6 +17,6 @@ var n: i8 = n * n; // CHECK:STDOUT: {kind: 'NameExpr', text: 'n'}, // CHECK:STDOUT: {kind: 'NameExpr', text: 'n'}, // CHECK:STDOUT: {kind: 'InfixOperator', text: '*', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 9}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 9}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/operators/infix_no_space.carbon b/toolchain/parse/testdata/operators/infix_no_space.carbon index 90467b7f132b..60ade1819f7f 100644 --- a/toolchain/parse/testdata/operators/infix_no_space.carbon +++ b/toolchain/parse/testdata/operators/infix_no_space.carbon @@ -17,6 +17,6 @@ var n: i8 = n*n; // CHECK:STDOUT: {kind: 'NameExpr', text: 'n'}, // CHECK:STDOUT: {kind: 'NameExpr', text: 'n'}, // CHECK:STDOUT: {kind: 'InfixOperator', text: '*', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 9}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 9}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/operators/infix_with_paren_after.carbon b/toolchain/parse/testdata/operators/infix_with_paren_after.carbon index 5e205d8385f7..6790b32f01de 100644 --- a/toolchain/parse/testdata/operators/infix_with_paren_after.carbon +++ b/toolchain/parse/testdata/operators/infix_with_paren_after.carbon @@ -19,6 +19,6 @@ var n: i8 = 3*(n); // CHECK:STDOUT: {kind: 'NameExpr', text: 'n'}, // CHECK:STDOUT: {kind: 'ParenExpr', text: ')', subtree_size: 3}, // CHECK:STDOUT: {kind: 'InfixOperator', text: '*', subtree_size: 5}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 11}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 11}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/operators/infix_with_paren_before.carbon b/toolchain/parse/testdata/operators/infix_with_paren_before.carbon index 5989e3e11c8f..fa1ed37bf24d 100644 --- a/toolchain/parse/testdata/operators/infix_with_paren_before.carbon +++ b/toolchain/parse/testdata/operators/infix_with_paren_before.carbon @@ -19,6 +19,6 @@ var n: i8 = (n)*3; // CHECK:STDOUT: {kind: 'ParenExpr', text: ')', subtree_size: 3}, // CHECK:STDOUT: {kind: 'Literal', text: '3'}, // CHECK:STDOUT: {kind: 'InfixOperator', text: '*', subtree_size: 5}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 11}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 11}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/operators/postfix.carbon b/toolchain/parse/testdata/operators/postfix.carbon index 50d0c260a2e6..157d5c5edf55 100644 --- a/toolchain/parse/testdata/operators/postfix.carbon +++ b/toolchain/parse/testdata/operators/postfix.carbon @@ -16,6 +16,6 @@ var v: type = i8*; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'Literal', text: 'i8'}, // CHECK:STDOUT: {kind: 'PostfixOperator', text: '*', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 8}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 8}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/operators/postfix_space_after_op.carbon b/toolchain/parse/testdata/operators/postfix_space_after_op.carbon index 7ad3e1949f5c..54b293ba58e7 100644 --- a/toolchain/parse/testdata/operators/postfix_space_after_op.carbon +++ b/toolchain/parse/testdata/operators/postfix_space_after_op.carbon @@ -16,6 +16,6 @@ var v: type = i8* ; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'Literal', text: 'i8'}, // CHECK:STDOUT: {kind: 'PostfixOperator', text: '*', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 8}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 8}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/operators/precedence_assign.carbon b/toolchain/parse/testdata/operators/precedence_assign.carbon index 41aacc1d98e7..4bbc600758cf 100644 --- a/toolchain/parse/testdata/operators/precedence_assign.carbon +++ b/toolchain/parse/testdata/operators/precedence_assign.carbon @@ -28,18 +28,18 @@ fn F(c: bool) { // CHECK:STDOUT: {kind: 'Name', text: 'a'}, // CHECK:STDOUT: {kind: 'Literal', text: 'i32'}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'}, // CHECK:STDOUT: {kind: 'Name', text: 'b'}, // CHECK:STDOUT: {kind: 'Literal', text: 'i32'}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'}, // CHECK:STDOUT: {kind: 'Name', text: 'p'}, // CHECK:STDOUT: {kind: 'Literal', text: 'i32'}, // CHECK:STDOUT: {kind: 'PostfixOperator', text: '*', subtree_size: 2}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 4}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 6}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 6}, // CHECK:STDOUT: {kind: 'NameExpr', text: 'p'}, // CHECK:STDOUT: {kind: 'PrefixOperator', text: '*', subtree_size: 2}, // CHECK:STDOUT: {kind: 'NameExpr', text: 'c'}, diff --git a/toolchain/parse/testdata/operators/prefix.carbon b/toolchain/parse/testdata/operators/prefix.carbon index dffab901dfef..ed5d32e09b26 100644 --- a/toolchain/parse/testdata/operators/prefix.carbon +++ b/toolchain/parse/testdata/operators/prefix.carbon @@ -17,7 +17,7 @@ var b: bool = not true; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'NameExpr', text: 'n'}, // CHECK:STDOUT: {kind: 'PrefixOperator', text: '-', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 8}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 8}, // CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'}, // CHECK:STDOUT: {kind: 'Name', text: 'b'}, // CHECK:STDOUT: {kind: 'Literal', text: 'bool'}, @@ -25,6 +25,6 @@ var b: bool = not true; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'Literal', text: 'true'}, // CHECK:STDOUT: {kind: 'PrefixOperator', text: 'not', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 8}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 8}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/operators/prefix_no_space.carbon b/toolchain/parse/testdata/operators/prefix_no_space.carbon index fd15585e5d1f..fd5f7946bf7c 100644 --- a/toolchain/parse/testdata/operators/prefix_no_space.carbon +++ b/toolchain/parse/testdata/operators/prefix_no_space.carbon @@ -17,6 +17,6 @@ var n: i8 =-n; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'NameExpr', text: 'n'}, // CHECK:STDOUT: {kind: 'PrefixOperator', text: '-', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 8}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 8}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/operators/recover_infix_uneven_space_before.carbon b/toolchain/parse/testdata/operators/recover_infix_uneven_space_before.carbon index a46606515f94..4e72b2fc0ac5 100644 --- a/toolchain/parse/testdata/operators/recover_infix_uneven_space_before.carbon +++ b/toolchain/parse/testdata/operators/recover_infix_uneven_space_before.carbon @@ -20,6 +20,6 @@ var n: i8 = n *n; // CHECK:STDOUT: {kind: 'NameExpr', text: 'n'}, // CHECK:STDOUT: {kind: 'NameExpr', text: 'n'}, // CHECK:STDOUT: {kind: 'InfixOperator', text: '*', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 9}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 9}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/operators/recover_postfix_space.carbon b/toolchain/parse/testdata/operators/recover_postfix_space.carbon index 55805dc61ab4..829f02a584f8 100644 --- a/toolchain/parse/testdata/operators/recover_postfix_space.carbon +++ b/toolchain/parse/testdata/operators/recover_postfix_space.carbon @@ -19,6 +19,6 @@ var v: type = i8 *; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'Literal', text: 'i8'}, // CHECK:STDOUT: {kind: 'PostfixOperator', text: '*', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 8}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 8}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/operators/recover_postfix_space_before_comma.carbon b/toolchain/parse/testdata/operators/recover_postfix_space_before_comma.carbon index 86be692b4a1a..d0338215d6ac 100644 --- a/toolchain/parse/testdata/operators/recover_postfix_space_before_comma.carbon +++ b/toolchain/parse/testdata/operators/recover_postfix_space_before_comma.carbon @@ -24,6 +24,6 @@ var n: i8 = F(i8 *, 0); // CHECK:STDOUT: {kind: 'CallExprComma', text: ','}, // CHECK:STDOUT: {kind: 'Literal', text: '0'}, // CHECK:STDOUT: {kind: 'CallExpr', text: ')', subtree_size: 7}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 13}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 13}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/operators/recover_postfix_space_in_call.carbon b/toolchain/parse/testdata/operators/recover_postfix_space_in_call.carbon index 06089510f677..43816ffc1662 100644 --- a/toolchain/parse/testdata/operators/recover_postfix_space_in_call.carbon +++ b/toolchain/parse/testdata/operators/recover_postfix_space_in_call.carbon @@ -22,6 +22,6 @@ var n: i8 = F(i8 *); // CHECK:STDOUT: {kind: 'Literal', text: 'i8'}, // CHECK:STDOUT: {kind: 'PostfixOperator', text: '*', subtree_size: 2}, // CHECK:STDOUT: {kind: 'CallExpr', text: ')', subtree_size: 5}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 11}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 11}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/operators/recover_postfix_space_surrounding.carbon b/toolchain/parse/testdata/operators/recover_postfix_space_surrounding.carbon index c03dc475c241..33da98ceb6cb 100644 --- a/toolchain/parse/testdata/operators/recover_postfix_space_surrounding.carbon +++ b/toolchain/parse/testdata/operators/recover_postfix_space_surrounding.carbon @@ -19,6 +19,6 @@ var v: type = i8 * ; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'Literal', text: 'i8'}, // CHECK:STDOUT: {kind: 'PostfixOperator', text: '*', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 8}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 8}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/operators/recover_prefix_space.carbon b/toolchain/parse/testdata/operators/recover_prefix_space.carbon index 60920994c076..a110b306c15a 100644 --- a/toolchain/parse/testdata/operators/recover_prefix_space.carbon +++ b/toolchain/parse/testdata/operators/recover_prefix_space.carbon @@ -19,6 +19,6 @@ var n: i8 = - n; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'NameExpr', text: 'n'}, // CHECK:STDOUT: {kind: 'PrefixOperator', text: '-', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 8}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 8}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/operators/recover_prefix_uneven_space_with_assign.carbon b/toolchain/parse/testdata/operators/recover_prefix_uneven_space_with_assign.carbon index 4e553f21ebf1..67ff6c45c32f 100644 --- a/toolchain/parse/testdata/operators/recover_prefix_uneven_space_with_assign.carbon +++ b/toolchain/parse/testdata/operators/recover_prefix_uneven_space_with_assign.carbon @@ -19,6 +19,6 @@ var n: i8 =- n; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'NameExpr', text: 'n'}, // CHECK:STDOUT: {kind: 'PrefixOperator', text: '-', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 8}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 8}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/packages/import/fail_after_decl.carbon b/toolchain/parse/testdata/packages/import/fail_after_decl.carbon index 0d5f0e416637..e638def19046 100644 --- a/toolchain/parse/testdata/packages/import/fail_after_decl.carbon +++ b/toolchain/parse/testdata/packages/import/fail_after_decl.carbon @@ -21,7 +21,7 @@ import B; // CHECK:STDOUT: {kind: 'Name', text: 'A'}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'ImportIntroducer', text: 'import'}, // CHECK:STDOUT: {kind: 'ImportDirective', text: ';', has_error: yes, subtree_size: 2}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, diff --git a/toolchain/parse/testdata/packages/import/fail_after_decl_repeated.carbon b/toolchain/parse/testdata/packages/import/fail_after_decl_repeated.carbon index 0086c2c8d84e..5ab78341e6ac 100644 --- a/toolchain/parse/testdata/packages/import/fail_after_decl_repeated.carbon +++ b/toolchain/parse/testdata/packages/import/fail_after_decl_repeated.carbon @@ -43,7 +43,7 @@ import G; // CHECK:STDOUT: {kind: 'Name', text: 'A'}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'ImportIntroducer', text: 'import'}, // CHECK:STDOUT: {kind: 'ImportDirective', text: ';', has_error: yes, subtree_size: 2}, // CHECK:STDOUT: {kind: 'ImportIntroducer', text: 'import'}, @@ -54,7 +54,7 @@ import G; // CHECK:STDOUT: {kind: 'Name', text: 'E'}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'ImportIntroducer', text: 'import'}, // CHECK:STDOUT: {kind: 'ImportDirective', text: ';', has_error: yes, subtree_size: 2}, // CHECK:STDOUT: {kind: 'ImportIntroducer', text: 'import'}, diff --git a/toolchain/parse/testdata/packages/package/fail_after_decl.carbon b/toolchain/parse/testdata/packages/package/fail_after_decl.carbon index aa22481fb542..7562c71425ef 100644 --- a/toolchain/parse/testdata/packages/package/fail_after_decl.carbon +++ b/toolchain/parse/testdata/packages/package/fail_after_decl.carbon @@ -21,7 +21,7 @@ package B api; // CHECK:STDOUT: {kind: 'Name', text: 'A'}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'FunctionDeclaration', text: ';', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'FunctionDecl', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'PackageIntroducer', text: 'package'}, // CHECK:STDOUT: {kind: 'PackageDirective', text: ';', has_error: yes, subtree_size: 2}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, diff --git a/toolchain/parse/testdata/pointer/pointer_type.carbon b/toolchain/parse/testdata/pointer/pointer_type.carbon index 9df8caeb5225..d2b33bf90615 100644 --- a/toolchain/parse/testdata/pointer/pointer_type.carbon +++ b/toolchain/parse/testdata/pointer/pointer_type.carbon @@ -42,6 +42,6 @@ var T: type = if true then i32* else f64*; // CHECK:STDOUT: {kind: 'Literal', text: 'f64'}, // CHECK:STDOUT: {kind: 'PostfixOperator', text: '*', subtree_size: 2}, // CHECK:STDOUT: {kind: 'IfExprElse', text: 'else', subtree_size: 8}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 14}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 14}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/pointer/pointer_value.carbon b/toolchain/parse/testdata/pointer/pointer_value.carbon index 06f8153ebe43..e5595dc89f05 100644 --- a/toolchain/parse/testdata/pointer/pointer_value.carbon +++ b/toolchain/parse/testdata/pointer/pointer_value.carbon @@ -27,7 +27,7 @@ fn F() -> i32 { // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'Literal', text: '0'}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 7}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 7}, // CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'}, // CHECK:STDOUT: {kind: 'Name', text: 'p'}, // CHECK:STDOUT: {kind: 'Literal', text: 'i32'}, @@ -36,7 +36,7 @@ fn F() -> i32 { // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'NameExpr', text: 'n'}, // CHECK:STDOUT: {kind: 'PrefixOperator', text: '&', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 9}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 9}, // CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'}, // CHECK:STDOUT: {kind: 'Name', text: 'q'}, // CHECK:STDOUT: {kind: 'Literal', text: 'i32'}, @@ -46,7 +46,7 @@ fn F() -> i32 { // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'NameExpr', text: 'p'}, // CHECK:STDOUT: {kind: 'PrefixOperator', text: '&', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 10}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 10}, // CHECK:STDOUT: {kind: 'ReturnStatementStart', text: 'return'}, // CHECK:STDOUT: {kind: 'NameExpr', text: 'q'}, // CHECK:STDOUT: {kind: 'PrefixOperator', text: '*', subtree_size: 2}, diff --git a/toolchain/parse/testdata/struct/fail_comma_only.carbon b/toolchain/parse/testdata/struct/fail_comma_only.carbon index be0fba39135f..e4cfc8822e1b 100644 --- a/toolchain/parse/testdata/struct/fail_comma_only.carbon +++ b/toolchain/parse/testdata/struct/fail_comma_only.carbon @@ -22,6 +22,6 @@ var x: {,} = {}; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'}, // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 11}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 11}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/struct/fail_comma_repeat_in_type.carbon b/toolchain/parse/testdata/struct/fail_comma_repeat_in_type.carbon index 3088c96f69cd..c31fc04085f1 100644 --- a/toolchain/parse/testdata/struct/fail_comma_repeat_in_type.carbon +++ b/toolchain/parse/testdata/struct/fail_comma_repeat_in_type.carbon @@ -27,6 +27,6 @@ var x: {.a: i32,,} = {}; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'}, // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 16}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 16}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/struct/fail_comma_repeat_in_value.carbon b/toolchain/parse/testdata/struct/fail_comma_repeat_in_value.carbon index e829f23e48be..602f41c3f512 100644 --- a/toolchain/parse/testdata/struct/fail_comma_repeat_in_value.carbon +++ b/toolchain/parse/testdata/struct/fail_comma_repeat_in_value.carbon @@ -27,6 +27,6 @@ var x: {.a = 0,,} = {}; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'}, // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 16}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 16}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/struct/fail_dot_only.carbon b/toolchain/parse/testdata/struct/fail_dot_only.carbon index 95268075ae18..622c980eca82 100644 --- a/toolchain/parse/testdata/struct/fail_dot_only.carbon +++ b/toolchain/parse/testdata/struct/fail_dot_only.carbon @@ -23,6 +23,6 @@ var x: {.} = {}; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'}, // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 12}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 12}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/struct/fail_dot_string_colon.carbon b/toolchain/parse/testdata/struct/fail_dot_string_colon.carbon index ee8ec21da9a7..db40088cd8dd 100644 --- a/toolchain/parse/testdata/struct/fail_dot_string_colon.carbon +++ b/toolchain/parse/testdata/struct/fail_dot_string_colon.carbon @@ -29,6 +29,6 @@ var x: {."hello": i32, .y: i32} = {}; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'}, // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 18}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 18}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/struct/fail_dot_string_equals.carbon b/toolchain/parse/testdata/struct/fail_dot_string_equals.carbon index 1a406474108f..ec58d82750eb 100644 --- a/toolchain/parse/testdata/struct/fail_dot_string_equals.carbon +++ b/toolchain/parse/testdata/struct/fail_dot_string_equals.carbon @@ -29,6 +29,6 @@ var x: {."hello" = 0, .y = 4} = {}; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'}, // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 18}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 18}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/struct/fail_extra_token_in_type.carbon b/toolchain/parse/testdata/struct/fail_extra_token_in_type.carbon index a3f2b33fbdd8..a720374983ff 100644 --- a/toolchain/parse/testdata/struct/fail_extra_token_in_type.carbon +++ b/toolchain/parse/testdata/struct/fail_extra_token_in_type.carbon @@ -28,6 +28,6 @@ var x: {.a: i32 banana} = {.a = 0}; // CHECK:STDOUT: {kind: 'Literal', text: '0'}, // CHECK:STDOUT: {kind: 'StructFieldValue', text: '=', subtree_size: 4}, // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 6}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 17}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 17}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/struct/fail_extra_token_in_value.carbon b/toolchain/parse/testdata/struct/fail_extra_token_in_value.carbon index 65163b68e81d..7e0d92557df2 100644 --- a/toolchain/parse/testdata/struct/fail_extra_token_in_value.carbon +++ b/toolchain/parse/testdata/struct/fail_extra_token_in_value.carbon @@ -28,6 +28,6 @@ var x: {.a: i32} = {.a = 0 banana}; // CHECK:STDOUT: {kind: 'Literal', text: '0'}, // CHECK:STDOUT: {kind: 'StructFieldValue', text: '=', subtree_size: 4}, // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', has_error: yes, subtree_size: 6}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 17}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 17}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/struct/fail_identifier_colon.carbon b/toolchain/parse/testdata/struct/fail_identifier_colon.carbon index b9cbdc516260..bba9b3dd7e6b 100644 --- a/toolchain/parse/testdata/struct/fail_identifier_colon.carbon +++ b/toolchain/parse/testdata/struct/fail_identifier_colon.carbon @@ -21,6 +21,6 @@ var x: {a:} = {}; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'}, // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 10}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 10}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/struct/fail_identifier_equals.carbon b/toolchain/parse/testdata/struct/fail_identifier_equals.carbon index 4ac5ce2ea983..44c5c8bc3689 100644 --- a/toolchain/parse/testdata/struct/fail_identifier_equals.carbon +++ b/toolchain/parse/testdata/struct/fail_identifier_equals.carbon @@ -21,6 +21,6 @@ var x: {a=} = {}; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'}, // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 10}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 10}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/struct/fail_identifier_only.carbon b/toolchain/parse/testdata/struct/fail_identifier_only.carbon index 92f7fe87be8a..bdaf4ccf1d34 100644 --- a/toolchain/parse/testdata/struct/fail_identifier_only.carbon +++ b/toolchain/parse/testdata/struct/fail_identifier_only.carbon @@ -21,6 +21,6 @@ var x: {a} = {}; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'}, // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 10}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 10}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/struct/fail_missing_type.carbon b/toolchain/parse/testdata/struct/fail_missing_type.carbon index a4d985105008..4c10dc8174ef 100644 --- a/toolchain/parse/testdata/struct/fail_missing_type.carbon +++ b/toolchain/parse/testdata/struct/fail_missing_type.carbon @@ -24,6 +24,6 @@ var x: {.a:} = {}; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'}, // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 13}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 13}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/struct/fail_missing_value.carbon b/toolchain/parse/testdata/struct/fail_missing_value.carbon index 8753792e9204..fb894339fa00 100644 --- a/toolchain/parse/testdata/struct/fail_missing_value.carbon +++ b/toolchain/parse/testdata/struct/fail_missing_value.carbon @@ -24,6 +24,6 @@ var x: {.a=} = {}; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'}, // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 13}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 13}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/struct/fail_mix_type_and_value.carbon b/toolchain/parse/testdata/struct/fail_mix_type_and_value.carbon index 9d7f39d2964d..32903ad4a051 100644 --- a/toolchain/parse/testdata/struct/fail_mix_type_and_value.carbon +++ b/toolchain/parse/testdata/struct/fail_mix_type_and_value.carbon @@ -28,6 +28,6 @@ var x: {.a: i32, .b = 0} = {}; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'}, // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 17}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 17}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/struct/fail_mix_value_and_type.carbon b/toolchain/parse/testdata/struct/fail_mix_value_and_type.carbon index 8e27ee378a7f..87eddd34e647 100644 --- a/toolchain/parse/testdata/struct/fail_mix_value_and_type.carbon +++ b/toolchain/parse/testdata/struct/fail_mix_value_and_type.carbon @@ -26,6 +26,6 @@ var x: {.a = 0, b: i32} = {}; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'}, // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 15}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 15}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/struct/fail_mix_with_unknown.carbon b/toolchain/parse/testdata/struct/fail_mix_with_unknown.carbon index 230c6b6fc5d1..748ba2f535bc 100644 --- a/toolchain/parse/testdata/struct/fail_mix_with_unknown.carbon +++ b/toolchain/parse/testdata/struct/fail_mix_with_unknown.carbon @@ -42,7 +42,7 @@ var x: i32 = {.a: i32, .b, .c = 1}; // CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2}, // CHECK:STDOUT: {kind: 'StructFieldUnknown', text: '.', has_error: yes}, // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 14}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 20}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 20}, // CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'}, // CHECK:STDOUT: {kind: 'Name', text: 'x'}, // CHECK:STDOUT: {kind: 'Literal', text: 'i32'}, @@ -62,6 +62,6 @@ var x: i32 = {.a: i32, .b, .c = 1}; // CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2}, // CHECK:STDOUT: {kind: 'StructFieldUnknown', text: '.', has_error: yes}, // CHECK:STDOUT: {kind: 'StructTypeLiteral', text: '}', subtree_size: 14}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 20}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 20}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/struct/fail_no_colon_or_equals.carbon b/toolchain/parse/testdata/struct/fail_no_colon_or_equals.carbon index 49eed97e0d13..28b516993762 100644 --- a/toolchain/parse/testdata/struct/fail_no_colon_or_equals.carbon +++ b/toolchain/parse/testdata/struct/fail_no_colon_or_equals.carbon @@ -23,6 +23,6 @@ var x: {.a} = {}; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'}, // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 12}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 12}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/struct/fail_type_no_designator.carbon b/toolchain/parse/testdata/struct/fail_type_no_designator.carbon index cb59957ce02f..bd4b89739f2f 100644 --- a/toolchain/parse/testdata/struct/fail_type_no_designator.carbon +++ b/toolchain/parse/testdata/struct/fail_type_no_designator.carbon @@ -21,6 +21,6 @@ var x: {i32} = {}; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'}, // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 10}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 10}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/struct/no_entries.carbon b/toolchain/parse/testdata/struct/no_entries.carbon index 1018d2ab8b16..5819e47058c3 100644 --- a/toolchain/parse/testdata/struct/no_entries.carbon +++ b/toolchain/parse/testdata/struct/no_entries.carbon @@ -17,6 +17,6 @@ var y: {} = {}; // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'}, // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 9}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 9}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/struct/one_entry_no_comma.carbon b/toolchain/parse/testdata/struct/one_entry_no_comma.carbon index 1bcf208ffbdd..57b9cb175e92 100644 --- a/toolchain/parse/testdata/struct/one_entry_no_comma.carbon +++ b/toolchain/parse/testdata/struct/one_entry_no_comma.carbon @@ -25,6 +25,6 @@ var z: {.n: i32} = {.n = 4}; // CHECK:STDOUT: {kind: 'Literal', text: '4'}, // CHECK:STDOUT: {kind: 'StructFieldValue', text: '=', subtree_size: 4}, // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 6}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 17}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 17}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/struct/one_entry_with_comma.carbon b/toolchain/parse/testdata/struct/one_entry_with_comma.carbon index f041451c2a35..64be6eee49c0 100644 --- a/toolchain/parse/testdata/struct/one_entry_with_comma.carbon +++ b/toolchain/parse/testdata/struct/one_entry_with_comma.carbon @@ -27,6 +27,6 @@ var z: {.n: i32,} = {.n = 4,}; // CHECK:STDOUT: {kind: 'StructFieldValue', text: '=', subtree_size: 4}, // CHECK:STDOUT: {kind: 'StructComma', text: ','}, // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 7}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 19}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 19}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/struct/two_entries.carbon b/toolchain/parse/testdata/struct/two_entries.carbon index 79d7be8f72cb..67c966997c78 100644 --- a/toolchain/parse/testdata/struct/two_entries.carbon +++ b/toolchain/parse/testdata/struct/two_entries.carbon @@ -35,6 +35,6 @@ var x: {.a: i32, .b: i32} = {.a = 1, .b = 2}; // CHECK:STDOUT: {kind: 'Literal', text: '2'}, // CHECK:STDOUT: {kind: 'StructFieldValue', text: '=', subtree_size: 4}, // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 11}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 27}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 27}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/tuple/nested.carbon b/toolchain/parse/testdata/tuple/nested.carbon index 3a8f8e5c23c3..a940cab91150 100644 --- a/toolchain/parse/testdata/tuple/nested.carbon +++ b/toolchain/parse/testdata/tuple/nested.carbon @@ -22,6 +22,6 @@ var y: ((), (), ()); // CHECK:STDOUT: {kind: 'TupleLiteral', text: ')', subtree_size: 2}, // CHECK:STDOUT: {kind: 'TupleLiteral', text: ')', subtree_size: 10}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 12}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 14}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 14}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/tuple/two_entries.carbon b/toolchain/parse/testdata/tuple/two_entries.carbon index 48d64a10d46a..6f692ca9466b 100644 --- a/toolchain/parse/testdata/tuple/two_entries.carbon +++ b/toolchain/parse/testdata/tuple/two_entries.carbon @@ -23,6 +23,6 @@ var x: (i32, i32) = (1, 2); // CHECK:STDOUT: {kind: 'TupleLiteralComma', text: ','}, // CHECK:STDOUT: {kind: 'Literal', text: '2'}, // CHECK:STDOUT: {kind: 'TupleLiteral', text: ')', subtree_size: 5}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 15}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 15}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/var/fail_bad_name.carbon b/toolchain/parse/testdata/var/fail_bad_name.carbon index ec969a9c6fad..3d916147c9c1 100644 --- a/toolchain/parse/testdata/var/fail_bad_name.carbon +++ b/toolchain/parse/testdata/var/fail_bad_name.carbon @@ -16,6 +16,6 @@ var *; // CHECK:STDOUT: {kind: 'Name', text: '*', has_error: yes}, // CHECK:STDOUT: {kind: 'InvalidParse', text: '*', has_error: yes}, // CHECK:STDOUT: {kind: 'PatternBinding', text: '*', has_error: yes, subtree_size: 3}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/var/fail_empty.carbon b/toolchain/parse/testdata/var/fail_empty.carbon index 5f84136afbdd..282b7494f796 100644 --- a/toolchain/parse/testdata/var/fail_empty.carbon +++ b/toolchain/parse/testdata/var/fail_empty.carbon @@ -16,6 +16,6 @@ var; // CHECK:STDOUT: {kind: 'Name', text: ';', has_error: yes}, // CHECK:STDOUT: {kind: 'InvalidParse', text: ';', has_error: yes}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ';', has_error: yes, subtree_size: 3}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/var/fail_no_semi.carbon b/toolchain/parse/testdata/var/fail_no_semi.carbon index 246fbf51f807..91424501de3a 100644 --- a/toolchain/parse/testdata/var/fail_no_semi.carbon +++ b/toolchain/parse/testdata/var/fail_no_semi.carbon @@ -19,6 +19,6 @@ var // CHECK:STDOUT: {kind: 'Name', text: '', has_error: yes}, // CHECK:STDOUT: {kind: 'InvalidParse', text: '', has_error: yes}, // CHECK:STDOUT: {kind: 'PatternBinding', text: '', has_error: yes, subtree_size: 3}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: 'var', has_error: yes, subtree_size: 5}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: 'var', has_error: yes, subtree_size: 5}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/testdata/var/var.carbon b/toolchain/parse/testdata/var/var.carbon index c0225d3cc736..1a197602cd16 100644 --- a/toolchain/parse/testdata/var/var.carbon +++ b/toolchain/parse/testdata/var/var.carbon @@ -19,12 +19,12 @@ fn F() { // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'Literal', text: '0'}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 7}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 7}, // CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'}, // CHECK:STDOUT: {kind: 'Name', text: 'w'}, // CHECK:STDOUT: {kind: 'Literal', text: 'i32'}, // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 5}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 5}, // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'}, // CHECK:STDOUT: {kind: 'Name', text: 'F'}, // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('}, @@ -36,7 +36,7 @@ fn F() { // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 3}, // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='}, // CHECK:STDOUT: {kind: 'Literal', text: '"hello"'}, -// CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 7}, +// CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 7}, // CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 13}, // CHECK:STDOUT: {kind: 'FileEnd', text: ''}, // CHECK:STDOUT: ] diff --git a/toolchain/parse/tree.cpp b/toolchain/parse/tree.cpp index 09d31cda2fd5..8993eb4c24df 100644 --- a/toolchain/parse/tree.cpp +++ b/toolchain/parse/tree.cpp @@ -29,7 +29,7 @@ auto Tree::Parse(Lex::TokenizedBuffer& tokens, DiagnosticConsumer& consumer, context.AddLeafNode(NodeKind::FileStart, context.ConsumeChecked(Lex::TokenKind::StartOfFile)); - context.PushState(State::DeclarationScopeLoop); + context.PushState(State::DeclScopeLoop); while (!context.state_stack().empty()) { // clang warns on unhandled enum values; clang-tidy is incorrect here. diff --git a/toolchain/parse/tree_test.cpp b/toolchain/parse/tree_test.cpp index d6f4ff1de45d..d3c66eca4fa0 100644 --- a/toolchain/parse/tree_test.cpp +++ b/toolchain/parse/tree_test.cpp @@ -70,8 +70,8 @@ TEST_F(TreeTest, PrintPostorderAsYAML) { ElementsAre(Pair("kind", "ParameterListStart"), Pair("text", "("))), Yaml::Mapping(ElementsAre(Pair("kind", "ParameterList"), Pair("text", ")"), Pair("subtree_size", "2"))), - Yaml::Mapping(ElementsAre(Pair("kind", "FunctionDeclaration"), - Pair("text", ";"), Pair("subtree_size", "5"))), + Yaml::Mapping(ElementsAre(Pair("kind", "FunctionDecl"), Pair("text", ";"), + Pair("subtree_size", "5"))), Yaml::Mapping(ElementsAre(Pair("kind", "FileEnd"), Pair("text", ""))))); auto root = Yaml::Sequence(ElementsAre(Yaml::Mapping( @@ -107,8 +107,8 @@ TEST_F(TreeTest, PrintPreorderAsYAML) { Yaml::Mapping(ElementsAre(Pair("node_index", "0"), Pair("kind", "FileStart"), Pair("text", ""))), Yaml::Mapping(ElementsAre(Pair("node_index", "5"), - Pair("kind", "FunctionDeclaration"), - Pair("text", ";"), Pair("subtree_size", "5"), + Pair("kind", "FunctionDecl"), Pair("text", ";"), + Pair("subtree_size", "5"), Pair("children", function_decl))), Yaml::Mapping(ElementsAre(Pair("node_index", "6"), Pair("kind", "FileEnd"), Pair("text", ""))))); diff --git a/toolchain/sem_ir/builtin_kind.h b/toolchain/sem_ir/builtin_kind.h index 2ad9b9484198..0c4c3061fa59 100644 --- a/toolchain/sem_ir/builtin_kind.h +++ b/toolchain/sem_ir/builtin_kind.h @@ -18,8 +18,7 @@ CARBON_DEFINE_RAW_ENUM_CLASS(BuiltinKind, uint8_t) { class BuiltinKind : public CARBON_ENUM_BASE(BuiltinKind) { public: -#define CARBON_SEM_IR_BUILTIN_KIND_NAME(Name) \ - CARBON_ENUM_CONSTANT_DECLARATION(Name) +#define CARBON_SEM_IR_BUILTIN_KIND_NAME(Name) CARBON_ENUM_CONSTANT_DECL(Name) #include "toolchain/sem_ir/builtin_kind.def" auto label() -> llvm::StringRef; diff --git a/toolchain/sem_ir/file.cpp b/toolchain/sem_ir/file.cpp index 5c77ebc4a1e4..28e7d23899fd 100644 --- a/toolchain/sem_ir/file.cpp +++ b/toolchain/sem_ir/file.cpp @@ -196,13 +196,13 @@ static auto GetTypePrecedence(InstKind kind) -> int { case BranchIf::Kind: case BranchWithArg::Kind: case Call::Kind: - case ClassDeclaration::Kind: + case ClassDecl::Kind: case ClassFieldAccess::Kind: case ClassInit::Kind: case Converted::Kind: case Dereference::Kind: case Field::Kind: - case FunctionDeclaration::Kind: + case FunctionDecl::Kind: case InitializeFrom::Kind: case IntegerLiteral::Kind: case Namespace::Kind: @@ -398,14 +398,14 @@ auto File::StringifyTypeExpr(InstId outer_inst_id, bool in_type_context) const case BranchWithArg::Kind: case Builtin::Kind: case Call::Kind: - case ClassDeclaration::Kind: + case ClassDecl::Kind: case ClassFieldAccess::Kind: case ClassInit::Kind: case Converted::Kind: case CrossReference::Kind: case Dereference::Kind: case Field::Kind: - case FunctionDeclaration::Kind: + case FunctionDecl::Kind: case InitializeFrom::Kind: case IntegerLiteral::Kind: case Namespace::Kind: @@ -470,9 +470,9 @@ auto GetExprCategory(const File& file, InstId inst_id) -> ExprCategory { case Branch::Kind: case BranchIf::Kind: case BranchWithArg::Kind: - case ClassDeclaration::Kind: + case ClassDecl::Kind: case Field::Kind: - case FunctionDeclaration::Kind: + case FunctionDecl::Kind: case Namespace::Kind: case NoOp::Kind: case Return::Kind: diff --git a/toolchain/sem_ir/file.h b/toolchain/sem_ir/file.h index b8505f8d3246..d376fa45532f 100644 --- a/toolchain/sem_ir/file.h +++ b/toolchain/sem_ir/file.h @@ -38,7 +38,7 @@ struct Function : public Printable { // The function name. NameId name_id; // The definition, if the function has been defined or is currently being - // defined. This is a FunctionDeclaration. + // defined. This is a FunctionDecl. InstId definition_id = InstId::Invalid; // A block containing a single reference instruction per implicit parameter. InstBlockId implicit_param_refs_id; @@ -76,12 +76,12 @@ struct Class : public Printable { NameId name_id; // The class type, which is the type of `Self` in the class definition. TypeId self_type_id; - // The first declaration of the class. This is a ClassDeclaration. - InstId declaration_id = InstId::Invalid; + // The first declaration of the class. This is a ClassDecl. + InstId decl_id = InstId::Invalid; // The following members are set at the `{` of the class definition. - // The definition of the class. This is a ClassDeclaration. + // The definition of the class. This is a ClassDecl. InstId definition_id = InstId::Invalid; // The class scope. NameScopeId scope_id = NameScopeId::Invalid; diff --git a/toolchain/sem_ir/formatter.cpp b/toolchain/sem_ir/formatter.cpp index 09989d52b6a3..211a8f087873 100644 --- a/toolchain/sem_ir/formatter.cpp +++ b/toolchain/sem_ir/formatter.cpp @@ -429,9 +429,9 @@ class InstNamer { add_inst_name_id(inst.As().name_id); continue; } - case FunctionDeclaration::Kind: { + case FunctionDecl::Kind: { add_inst_name_id(sem_ir_.functions() - .Get(inst.As().function_id) + .Get(inst.As().function_id) .name_id); continue; } diff --git a/toolchain/sem_ir/inst_kind.def b/toolchain/sem_ir/inst_kind.def index c01e341373bb..421096a785f6 100644 --- a/toolchain/sem_ir/inst_kind.def +++ b/toolchain/sem_ir/inst_kind.def @@ -33,7 +33,7 @@ CARBON_SEM_IR_INST_KIND(BranchIf) CARBON_SEM_IR_INST_KIND(BranchWithArg) CARBON_SEM_IR_INST_KIND(Builtin) CARBON_SEM_IR_INST_KIND(Call) -CARBON_SEM_IR_INST_KIND(ClassDeclaration) +CARBON_SEM_IR_INST_KIND(ClassDecl) CARBON_SEM_IR_INST_KIND(ClassFieldAccess) CARBON_SEM_IR_INST_KIND(ClassInit) CARBON_SEM_IR_INST_KIND(ClassType) @@ -42,7 +42,7 @@ CARBON_SEM_IR_INST_KIND(Converted) CARBON_SEM_IR_INST_KIND(CrossReference) CARBON_SEM_IR_INST_KIND(Dereference) CARBON_SEM_IR_INST_KIND(Field) -CARBON_SEM_IR_INST_KIND(FunctionDeclaration) +CARBON_SEM_IR_INST_KIND(FunctionDecl) CARBON_SEM_IR_INST_KIND(InitializeFrom) CARBON_SEM_IR_INST_KIND(IntegerLiteral) CARBON_SEM_IR_INST_KIND(NameReference) diff --git a/toolchain/sem_ir/inst_kind.h b/toolchain/sem_ir/inst_kind.h index 5b21a131523b..cb0bfcafbfa7 100644 --- a/toolchain/sem_ir/inst_kind.h +++ b/toolchain/sem_ir/inst_kind.h @@ -45,7 +45,7 @@ CARBON_DEFINE_RAW_ENUM_CLASS(InstKind, uint8_t) { class InstKind : public CARBON_ENUM_BASE(InstKind) { public: -#define CARBON_SEM_IR_INST_KIND(Name) CARBON_ENUM_CONSTANT_DECLARATION(Name) +#define CARBON_SEM_IR_INST_KIND(Name) CARBON_ENUM_CONSTANT_DECL(Name) #include "toolchain/sem_ir/inst_kind.def" using EnumBase::Create; diff --git a/toolchain/sem_ir/typed_insts.h b/toolchain/sem_ir/typed_insts.h index 86880fb749e4..e062ff79acec 100644 --- a/toolchain/sem_ir/typed_insts.h +++ b/toolchain/sem_ir/typed_insts.h @@ -192,9 +192,8 @@ struct Call { InstBlockId args_id; }; -struct ClassDeclaration { - static constexpr auto Kind = - InstKind::ClassDeclaration.Define("class_declaration"); +struct ClassDecl { + static constexpr auto Kind = InstKind::ClassDecl.Define("class_decl"); Parse::Node parse_node; // No type: a class declaration is not itself a value. The name of a class @@ -283,8 +282,8 @@ struct Field { MemberIndex index; }; -struct FunctionDeclaration { - static constexpr auto Kind = InstKind::FunctionDeclaration.Define("fn_decl"); +struct FunctionDecl { + static constexpr auto Kind = InstKind::FunctionDecl.Define("fn_decl"); Parse::Node parse_node; TypeId type_id;