diff --git a/src/quick-lint-js/fe/buffering-visitor.cpp b/src/quick-lint-js/fe/buffering-visitor.cpp index 7d6c905ac9..658c018ae5 100644 --- a/src/quick-lint-js/fe/buffering-visitor.cpp +++ b/src/quick-lint-js/fe/buffering-visitor.cpp @@ -71,7 +71,7 @@ void Buffering_Visitor::copy_into(Parse_Visitor_Base &target) const { target.visit_enter_namespace_scope(); break; case Visit_Kind::enter_type_alias_scope: - target.visit_enter_type_alias_scope(); + target.visit_enter_type_scope(); break; case Visit_Kind::exit_block_scope: target.visit_exit_block_scope(); @@ -113,7 +113,7 @@ void Buffering_Visitor::copy_into(Parse_Visitor_Base &target) const { target.visit_exit_namespace_scope(); break; case Visit_Kind::exit_type_alias_scope: - target.visit_exit_type_alias_scope(); + target.visit_exit_type_scope(); break; case Visit_Kind::keyword_variable_use: target.visit_keyword_variable_use(v.name); @@ -231,7 +231,7 @@ void Buffering_Visitor::visit_enter_namespace_scope() { this->add(Visit_Kind::enter_namespace_scope); } -void Buffering_Visitor::visit_enter_type_alias_scope() { +void Buffering_Visitor::visit_enter_type_scope() { this->add(Visit_Kind::enter_type_alias_scope); } @@ -287,7 +287,7 @@ void Buffering_Visitor::visit_exit_namespace_scope() { this->add(Visit_Kind::exit_namespace_scope); } -void Buffering_Visitor::visit_exit_type_alias_scope() { +void Buffering_Visitor::visit_exit_type_scope() { this->add(Visit_Kind::exit_type_alias_scope); } diff --git a/src/quick-lint-js/fe/buffering-visitor.h b/src/quick-lint-js/fe/buffering-visitor.h index d598a175df..3616d6da32 100644 --- a/src/quick-lint-js/fe/buffering-visitor.h +++ b/src/quick-lint-js/fe/buffering-visitor.h @@ -49,7 +49,7 @@ class Buffering_Visitor final : public Parse_Visitor_Base { void visit_enter_index_signature_scope() override; void visit_enter_interface_scope() override; void visit_enter_namespace_scope() override; - void visit_enter_type_alias_scope() override; + void visit_enter_type_scope() override; void visit_enter_named_function_scope(Identifier name) override; void visit_exit_block_scope() override; void visit_exit_with_scope() override; @@ -63,7 +63,7 @@ class Buffering_Visitor final : public Parse_Visitor_Base { void visit_exit_function_scope() override; void visit_exit_index_signature_scope() override; void visit_exit_namespace_scope() override; - void visit_exit_type_alias_scope() override; + void visit_exit_type_scope() override; void visit_exit_interface_scope() override; void visit_keyword_variable_use(Identifier name) override; void visit_property_declaration( diff --git a/src/quick-lint-js/fe/debug-parse-visitor.h b/src/quick-lint-js/fe/debug-parse-visitor.h index 9517bfea56..6b9b975092 100644 --- a/src/quick-lint-js/fe/debug-parse-visitor.h +++ b/src/quick-lint-js/fe/debug-parse-visitor.h @@ -104,7 +104,7 @@ class Debug_Parse_Visitor final : public Parse_Visitor_Base { this->output_->flush(); } - void visit_enter_type_alias_scope() override { + void visit_enter_type_scope() override { this->output_->append_copy(u8"entered type alias scope\n"_sv); this->output_->flush(); } @@ -174,7 +174,7 @@ class Debug_Parse_Visitor final : public Parse_Visitor_Base { this->output_->flush(); } - void visit_exit_type_alias_scope() override { + void visit_exit_type_scope() override { this->output_->append_copy(u8"exited type alias scope\n"_sv); this->output_->flush(); } diff --git a/src/quick-lint-js/fe/multi-parse-visitor.h b/src/quick-lint-js/fe/multi-parse-visitor.h index ec9ecd90aa..8642ec919d 100644 --- a/src/quick-lint-js/fe/multi-parse-visitor.h +++ b/src/quick-lint-js/fe/multi-parse-visitor.h @@ -98,9 +98,9 @@ class Multi_Parse_Visitor final : public Parse_Visitor_Base { this->visitor_2_->visit_enter_namespace_scope(); } - void visit_enter_type_alias_scope() override { - this->visitor_1_->visit_enter_type_alias_scope(); - this->visitor_2_->visit_enter_type_alias_scope(); + void visit_enter_type_scope() override { + this->visitor_1_->visit_enter_type_scope(); + this->visitor_2_->visit_enter_type_scope(); } void visit_exit_block_scope() override { @@ -168,9 +168,9 @@ class Multi_Parse_Visitor final : public Parse_Visitor_Base { this->visitor_2_->visit_exit_namespace_scope(); } - void visit_exit_type_alias_scope() override { - this->visitor_1_->visit_exit_type_alias_scope(); - this->visitor_2_->visit_exit_type_alias_scope(); + void visit_exit_type_scope() override { + this->visitor_1_->visit_exit_type_scope(); + this->visitor_2_->visit_exit_type_scope(); } void visit_keyword_variable_use(Identifier name) override { diff --git a/src/quick-lint-js/fe/null-visitor.h b/src/quick-lint-js/fe/null-visitor.h index f999c2bc7d..c7ced912f1 100644 --- a/src/quick-lint-js/fe/null-visitor.h +++ b/src/quick-lint-js/fe/null-visitor.h @@ -28,7 +28,7 @@ class Null_Visitor final : public Parse_Visitor_Base { void visit_enter_interface_scope() override {} void visit_enter_named_function_scope(Identifier) override {} void visit_enter_namespace_scope() override {} - void visit_enter_type_alias_scope() override {} + void visit_enter_type_scope() override {} void visit_exit_block_scope() override {} void visit_exit_with_scope() override {} void visit_exit_class_construct_scope() override {} @@ -42,7 +42,7 @@ class Null_Visitor final : public Parse_Visitor_Base { void visit_exit_index_signature_scope() override {} void visit_exit_interface_scope() override {} void visit_exit_namespace_scope() override {} - void visit_exit_type_alias_scope() override {} + void visit_exit_type_scope() override {} void visit_keyword_variable_use(Identifier) override {} void visit_property_declaration(const std::optional&) override {} void visit_variable_assignment(Identifier) override {} diff --git a/src/quick-lint-js/fe/parse-statement.cpp b/src/quick-lint-js/fe/parse-statement.cpp index 8e1ebc506d..3079febdb3 100644 --- a/src/quick-lint-js/fe/parse-statement.cpp +++ b/src/quick-lint-js/fe/parse-statement.cpp @@ -3390,7 +3390,7 @@ void Parser::parse_and_visit_typescript_type_alias( v.visit_variable_declaration(name, kind, Variable_Declaration_Flags::none); this->skip(); - v.visit_enter_type_alias_scope(); + v.visit_enter_type_scope(); if (this->peek().type == Token_Type::less) { this->parse_and_visit_typescript_generic_parameters(v); } @@ -3403,7 +3403,7 @@ void Parser::parse_and_visit_typescript_type_alias( .name = name, .kind = kind, }}); - v.visit_exit_type_alias_scope(); + v.visit_exit_type_scope(); this->consume_semicolon_after_statement(); } diff --git a/src/quick-lint-js/fe/parse-visitor.h b/src/quick-lint-js/fe/parse-visitor.h index 46836c7932..43bfa8b70c 100644 --- a/src/quick-lint-js/fe/parse-visitor.h +++ b/src/quick-lint-js/fe/parse-visitor.h @@ -38,7 +38,7 @@ class Parse_Visitor_Base { virtual void visit_enter_interface_scope() = 0; virtual void visit_enter_named_function_scope(Identifier) = 0; virtual void visit_enter_namespace_scope() = 0; - virtual void visit_enter_type_alias_scope() = 0; + virtual void visit_enter_type_scope() = 0; virtual void visit_exit_block_scope() = 0; virtual void visit_exit_with_scope() = 0; virtual void visit_exit_class_construct_scope() = 0; @@ -52,7 +52,7 @@ class Parse_Visitor_Base { virtual void visit_exit_index_signature_scope() = 0; virtual void visit_exit_interface_scope() = 0; virtual void visit_exit_namespace_scope() = 0; - virtual void visit_exit_type_alias_scope() = 0; + virtual void visit_exit_type_scope() = 0; virtual void visit_keyword_variable_use(Identifier name) = 0; virtual void visit_property_declaration( const std::optional &) = 0; diff --git a/src/quick-lint-js/fe/variable-analyzer.cpp b/src/quick-lint-js/fe/variable-analyzer.cpp index 167e43fa08..8f5e3bf802 100644 --- a/src/quick-lint-js/fe/variable-analyzer.cpp +++ b/src/quick-lint-js/fe/variable-analyzer.cpp @@ -179,7 +179,7 @@ void Variable_Analyzer::visit_enter_named_function_scope( void Variable_Analyzer::visit_enter_namespace_scope() { this->scopes_.push(); } -void Variable_Analyzer::visit_enter_type_alias_scope() { this->scopes_.push(); } +void Variable_Analyzer::visit_enter_type_scope() { this->scopes_.push(); } void Variable_Analyzer::visit_exit_block_scope() { QLJS_ASSERT(!this->scopes_.empty()); @@ -281,7 +281,7 @@ void Variable_Analyzer::visit_exit_namespace_scope() { this->scopes_.pop(); } -void Variable_Analyzer::visit_exit_type_alias_scope() { +void Variable_Analyzer::visit_exit_type_scope() { QLJS_ASSERT(!this->scopes_.empty()); this->propagate_variable_uses_to_parent_scope( /*allow_variable_use_before_declaration=*/false, diff --git a/src/quick-lint-js/fe/variable-analyzer.h b/src/quick-lint-js/fe/variable-analyzer.h index 94e8bde94f..518013bff4 100644 --- a/src/quick-lint-js/fe/variable-analyzer.h +++ b/src/quick-lint-js/fe/variable-analyzer.h @@ -69,7 +69,7 @@ class Variable_Analyzer final : public Parse_Visitor_Base { void visit_enter_interface_scope() override; void visit_enter_named_function_scope(Identifier) override; void visit_enter_namespace_scope() override; - void visit_enter_type_alias_scope() override; + void visit_enter_type_scope() override; void visit_exit_block_scope() override; void visit_exit_with_scope() override; void visit_exit_class_construct_scope() override; @@ -83,7 +83,7 @@ class Variable_Analyzer final : public Parse_Visitor_Base { void visit_exit_index_signature_scope() override; void visit_exit_interface_scope() override; void visit_exit_namespace_scope() override; - void visit_exit_type_alias_scope() override; + void visit_exit_type_scope() override; void visit_keyword_variable_use(Identifier name) override; void visit_property_declaration(const std::optional &) override; void visit_variable_declaration(Identifier name, Variable_Kind kind, diff --git a/test/quick-lint-js/spy-visitor.h b/test/quick-lint-js/spy-visitor.h index 29236b19f6..bf826a4492 100644 --- a/test/quick-lint-js/spy-visitor.h +++ b/test/quick-lint-js/spy-visitor.h @@ -306,8 +306,8 @@ struct Parse_Visit_Collector : public Parse_Visitor_Base { this->visits.emplace_back("visit_enter_namespace_scope"); } - void visit_enter_type_alias_scope() override { - this->visits.emplace_back("visit_enter_type_alias_scope"); + void visit_enter_type_scope() override { + this->visits.emplace_back("visit_enter_type_scope"); } std::vector enter_named_function_scopes; @@ -364,8 +364,8 @@ struct Parse_Visit_Collector : public Parse_Visitor_Base { this->visits.emplace_back("visit_exit_namespace_scope"); } - void visit_exit_type_alias_scope() override { - this->visits.emplace_back("visit_exit_type_alias_scope"); + void visit_exit_type_scope() override { + this->visits.emplace_back("visit_exit_type_scope"); } void visit_keyword_variable_use(Identifier name) override { diff --git a/test/test-parse-typescript-declare-namespace.cpp b/test/test-parse-typescript-declare-namespace.cpp index cf27b467af..5495c3d037 100644 --- a/test/test-parse-typescript-declare-namespace.cpp +++ b/test/test-parse-typescript-declare-namespace.cpp @@ -313,15 +313,15 @@ TEST_F(Test_Parse_TypeScript_Declare_Namespace, u8"Diag_Declare_Keyword_Is_Not_Allowed_Inside_Declare_Namespace"_diag, // typescript_options); EXPECT_THAT(p.visits, ElementsAreArray({ - "visit_enter_declare_scope", // - "visit_enter_namespace_scope", // { - "visit_variable_declaration", // T - "visit_enter_type_alias_scope", // - "visit_variable_type_use", // U - "visit_exit_type_alias_scope", // - "visit_exit_namespace_scope", // } - "visit_variable_declaration", // ns - "visit_exit_declare_scope", // + "visit_enter_declare_scope", // + "visit_enter_namespace_scope", // { + "visit_variable_declaration", // T + "visit_enter_type_scope", // + "visit_variable_type_use", // U + "visit_exit_type_scope", // + "visit_exit_namespace_scope", // } + "visit_variable_declaration", // ns + "visit_exit_declare_scope", // })); } @@ -408,16 +408,16 @@ TEST_F(Test_Parse_TypeScript_Declare_Namespace, test_parse_and_visit_module(u8"declare namespace ns { type T = U; }"_sv, no_diags, typescript_options); EXPECT_THAT(p.visits, ElementsAreArray({ - "visit_enter_declare_scope", // - "visit_enter_namespace_scope", // { - "visit_variable_declaration", // T - "visit_enter_type_alias_scope", // { - "visit_variable_type_use", // U - "visit_exit_type_alias_scope", // } - "visit_exit_namespace_scope", // } - "visit_variable_declaration", // ns - "visit_exit_declare_scope", // - "visit_end_of_module", // + "visit_enter_declare_scope", // + "visit_enter_namespace_scope", // { + "visit_variable_declaration", // T + "visit_enter_type_scope", // { + "visit_variable_type_use", // U + "visit_exit_type_scope", // } + "visit_exit_namespace_scope", // } + "visit_variable_declaration", // ns + "visit_exit_declare_scope", // + "visit_end_of_module", // })); } @@ -426,16 +426,16 @@ TEST_F(Test_Parse_TypeScript_Declare_Namespace, u8"declare namespace ns { export type T = U; }"_sv, no_diags, typescript_options); EXPECT_THAT(p.visits, ElementsAreArray({ - "visit_enter_declare_scope", // - "visit_enter_namespace_scope", // { - "visit_variable_declaration", // T - "visit_enter_type_alias_scope", // { - "visit_variable_type_use", // U - "visit_exit_type_alias_scope", // } - "visit_exit_namespace_scope", // } - "visit_variable_declaration", // ns - "visit_exit_declare_scope", // - "visit_end_of_module", // + "visit_enter_declare_scope", // + "visit_enter_namespace_scope", // { + "visit_variable_declaration", // T + "visit_enter_type_scope", // { + "visit_variable_type_use", // U + "visit_exit_type_scope", // } + "visit_exit_namespace_scope", // } + "visit_variable_declaration", // ns + "visit_exit_declare_scope", // + "visit_end_of_module", // })); } } diff --git a/test/test-parse-typescript-declare-type-alias.cpp b/test/test-parse-typescript-declare-type-alias.cpp index 6fb0f343dc..5158d16c6e 100644 --- a/test/test-parse-typescript-declare-type-alias.cpp +++ b/test/test-parse-typescript-declare-type-alias.cpp @@ -34,10 +34,10 @@ TEST_F(Test_Parse_TypeScript_Declare_Type_Alias, declare_type_acts_like_type) { Spy_Visitor p = test_parse_and_visit_statement( u8"declare type MyType = OtherType;"_sv, no_diags, typescript_options); EXPECT_THAT(p.visits, ElementsAreArray({ - "visit_variable_declaration", // MyType - "visit_enter_type_alias_scope", // - "visit_variable_type_use", // OtherType - "visit_exit_type_alias_scope", // + "visit_variable_declaration", // MyType + "visit_enter_type_scope", // + "visit_variable_type_use", // OtherType + "visit_exit_type_scope", // })); EXPECT_THAT(p.variable_uses, ElementsAreArray({u8"OtherType"_sv})); EXPECT_THAT(p.variable_declarations, @@ -51,12 +51,12 @@ TEST_F(Test_Parse_TypeScript_Declare_Type_Alias, Spy_Visitor p = test_parse_and_visit_module( u8"declare\ntype MyType = OtherType;"_sv, no_diags, typescript_options); EXPECT_THAT(p.visits, ElementsAreArray({ - "visit_variable_use", // declare - "visit_variable_declaration", // MyType - "visit_enter_type_alias_scope", // - "visit_variable_type_use", // OtherType - "visit_exit_type_alias_scope", // - "visit_end_of_module", // + "visit_variable_use", // declare + "visit_variable_declaration", // MyType + "visit_enter_type_scope", // + "visit_variable_type_use", // OtherType + "visit_exit_type_scope", // + "visit_end_of_module", // })); EXPECT_THAT(p.variable_uses, ElementsAreArray({u8"declare"_sv, u8"OtherType"_sv})); diff --git a/test/test-parse-typescript-module.cpp b/test/test-parse-typescript-module.cpp index 9843908cbf..97b7dfe7db 100644 --- a/test/test-parse-typescript-module.cpp +++ b/test/test-parse-typescript-module.cpp @@ -674,10 +674,10 @@ TEST_F(Test_Parse_TypeScript_Module, export_type_alias) { Spy_Visitor p = test_parse_and_visit_module(u8"export type T = C;"_sv, no_diags, typescript_options); EXPECT_THAT(p.visits, ElementsAreArray({ - "visit_variable_declaration", // T - "visit_enter_type_alias_scope", // - "visit_variable_type_use", // C - "visit_exit_type_alias_scope", // + "visit_variable_declaration", // T + "visit_enter_type_scope", // + "visit_variable_type_use", // C + "visit_exit_type_scope", // "visit_end_of_module", })); EXPECT_THAT(p.variable_declarations, @@ -693,9 +693,9 @@ TEST_F(Test_Parse_TypeScript_Module, u8" ^^^^ Diag_Newline_Not_Allowed_After_Type_Keyword"_diag, // typescript_options); EXPECT_THAT(p.visits, ElementsAreArray({ - "visit_variable_declaration", // A - "visit_enter_type_alias_scope", // - "visit_exit_type_alias_scope", // + "visit_variable_declaration", // A + "visit_enter_type_scope", // + "visit_exit_type_scope", // "visit_end_of_module", })); } diff --git a/test/test-parse-typescript-type-alias.cpp b/test/test-parse-typescript-type-alias.cpp index 3e2267e83c..0d9220ffb0 100644 --- a/test/test-parse-typescript-type-alias.cpp +++ b/test/test-parse-typescript-type-alias.cpp @@ -27,10 +27,10 @@ TEST_F(Test_Parse_TypeScript_Type_Alias, type_alias) { Spy_Visitor p = test_parse_and_visit_statement(u8"type T = U;"_sv, no_diags, typescript_options); EXPECT_THAT(p.visits, ElementsAreArray({ - "visit_variable_declaration", // T - "visit_enter_type_alias_scope", // T - "visit_variable_type_use", // U - "visit_exit_type_alias_scope", // T + "visit_variable_declaration", // T + "visit_enter_type_scope", // T + "visit_variable_type_use", // U + "visit_exit_type_scope", // T })); EXPECT_THAT(p.variable_uses, ElementsAreArray({u8"U"})); EXPECT_THAT(p.variable_declarations, @@ -41,11 +41,11 @@ TEST_F(Test_Parse_TypeScript_Type_Alias, type_alias) { Spy_Visitor p = test_parse_and_visit_statement( u8"type MyAlias = U;"_sv, no_diags, typescript_options); EXPECT_THAT(p.visits, ElementsAreArray({ - "visit_variable_declaration", // MyAlias - "visit_enter_type_alias_scope", // MyAlias - "visit_variable_declaration", // T - "visit_variable_type_use", // U - "visit_exit_type_alias_scope", // MyAlias + "visit_variable_declaration", // MyAlias + "visit_enter_type_scope", // MyAlias + "visit_variable_declaration", // T + "visit_variable_type_use", // U + "visit_exit_type_scope", // MyAlias })); EXPECT_THAT(p.variable_uses, ElementsAreArray({u8"U"})); EXPECT_THAT(p.variable_declarations, @@ -59,10 +59,10 @@ TEST_F(Test_Parse_TypeScript_Type_Alias, type_alias_requires_semicolon_or_asi) { Spy_Visitor p = test_parse_and_visit_statement(u8"type T = U"_sv, no_diags, typescript_options); EXPECT_THAT(p.visits, ElementsAreArray({ - "visit_variable_declaration", // T - "visit_enter_type_alias_scope", // T - "visit_variable_type_use", // U - "visit_exit_type_alias_scope", // T + "visit_variable_declaration", // T + "visit_enter_type_scope", // T + "visit_variable_type_use", // U + "visit_exit_type_scope", // T })); } @@ -70,14 +70,14 @@ TEST_F(Test_Parse_TypeScript_Type_Alias, type_alias_requires_semicolon_or_asi) { Spy_Visitor p = test_parse_and_visit_module(u8"type T = U\ntype V = W;"_sv, no_diags, typescript_options); EXPECT_THAT(p.visits, ElementsAreArray({ - "visit_variable_declaration", // T - "visit_enter_type_alias_scope", // T - "visit_variable_type_use", // U - "visit_exit_type_alias_scope", // T - "visit_variable_declaration", // V - "visit_enter_type_alias_scope", // V - "visit_variable_type_use", // W - "visit_exit_type_alias_scope", // V + "visit_variable_declaration", // T + "visit_enter_type_scope", // T + "visit_variable_type_use", // U + "visit_exit_type_scope", // T + "visit_variable_declaration", // V + "visit_enter_type_scope", // V + "visit_variable_type_use", // W + "visit_exit_type_scope", // V "visit_end_of_module", })); } @@ -88,14 +88,14 @@ TEST_F(Test_Parse_TypeScript_Type_Alias, type_alias_requires_semicolon_or_asi) { u8" ` Diag_Missing_Semicolon_After_Statement"_diag, // typescript_options); EXPECT_THAT(p.visits, ElementsAreArray({ - "visit_variable_declaration", // T - "visit_enter_type_alias_scope", // T - "visit_variable_type_use", // U - "visit_exit_type_alias_scope", // T - "visit_variable_declaration", // V - "visit_enter_type_alias_scope", // V - "visit_variable_type_use", // W - "visit_exit_type_alias_scope", // V + "visit_variable_declaration", // T + "visit_enter_type_scope", // T + "visit_variable_type_use", // U + "visit_exit_type_scope", // T + "visit_variable_declaration", // V + "visit_enter_type_scope", // V + "visit_variable_type_use", // W + "visit_exit_type_scope", // V "visit_end_of_module", })); } @@ -248,9 +248,9 @@ TEST_F(Test_Parse_TypeScript_Type_Alias, no_diags, typescript_options); EXPECT_THAT(v.visits, ElementsAreArray({ "visit_variable_declaration", // T - "visit_enter_type_alias_scope", // + "visit_enter_type_scope", // "visit_variable_namespace_use", // T (in T.foo) - "visit_exit_type_alias_scope", // + "visit_exit_type_scope", // })); } @@ -269,10 +269,10 @@ TEST_F(Test_Parse_TypeScript_Type_Alias, SCOPED_TRACE(p.code); p.parse_and_visit_statement(); EXPECT_THAT(p.visits, ElementsAreArray({ - "visit_variable_declaration", // (name) - "visit_enter_type_alias_scope", // (name) - "visit_variable_type_use", // T - "visit_exit_type_alias_scope", // (name) + "visit_variable_declaration", // (name) + "visit_enter_type_scope", // (name) + "visit_variable_type_use", // T + "visit_exit_type_scope", // (name) })); EXPECT_THAT(p.variable_declarations, ElementsAreArray({type_alias_decl(name)})); @@ -301,10 +301,10 @@ TEST_F(Test_Parse_TypeScript_Type_Alias, type_alias_not_allowed_in_javascript) { u8"^^^^ Diag_TypeScript_Type_Alias_Not_Allowed_In_JavaScript"_diag, // javascript_options); EXPECT_THAT(p.visits, ElementsAreArray({ - "visit_variable_declaration", // T - "visit_enter_type_alias_scope", // (name) - "visit_variable_type_use", // U - "visit_exit_type_alias_scope", // (name) + "visit_variable_declaration", // T + "visit_enter_type_scope", // (name) + "visit_variable_type_use", // U + "visit_exit_type_scope", // (name) })); } } diff --git a/test/test-parse-typescript-type.cpp b/test/test-parse-typescript-type.cpp index 2d9415d163..feadcf86f1 100644 --- a/test/test-parse-typescript-type.cpp +++ b/test/test-parse-typescript-type.cpp @@ -1910,12 +1910,12 @@ TEST_F(Test_Parse_TypeScript_Type, Spy_Visitor v = test_parse_and_visit_module( u8"type A = C\n[].forEach(f);"_sv, no_diags, typescript_options); EXPECT_THAT(v.visits, ElementsAreArray({ - "visit_variable_declaration", // A - "visit_enter_type_alias_scope", // - "visit_variable_type_use", // C - "visit_exit_type_alias_scope", // - "visit_variable_use", // f - "visit_end_of_module", // + "visit_variable_declaration", // A + "visit_enter_type_scope", // + "visit_variable_type_use", // C + "visit_exit_type_scope", // + "visit_variable_use", // f + "visit_end_of_module", // })); } @@ -1924,12 +1924,12 @@ TEST_F(Test_Parse_TypeScript_Type, Spy_Visitor v = test_parse_and_visit_module(u8"type A = C\n[T];"_sv, no_diags, typescript_options); EXPECT_THAT(v.visits, ElementsAreArray({ - "visit_variable_declaration", // A - "visit_enter_type_alias_scope", // - "visit_variable_type_use", // C - "visit_exit_type_alias_scope", // - "visit_variable_use", // T - "visit_end_of_module", // + "visit_variable_declaration", // A + "visit_enter_type_scope", // + "visit_variable_type_use", // C + "visit_exit_type_scope", // + "visit_variable_use", // T + "visit_end_of_module", // })); } @@ -1938,12 +1938,12 @@ TEST_F(Test_Parse_TypeScript_Type, Spy_Visitor v = test_parse_and_visit_module(u8"type A = typeof C\n[T];"_sv, no_diags, typescript_options); EXPECT_THAT(v.visits, ElementsAreArray({ - "visit_variable_declaration", // A - "visit_enter_type_alias_scope", // - "visit_variable_use", // C - "visit_exit_type_alias_scope", // - "visit_variable_use", // T - "visit_end_of_module", // + "visit_variable_declaration", // A + "visit_enter_type_scope", // + "visit_variable_use", // C + "visit_exit_type_scope", // + "visit_variable_use", // T + "visit_end_of_module", // })); } } @@ -1953,11 +1953,11 @@ TEST_F(Test_Parse_TypeScript_Type, newline_is_allowed_before_tuple_type) { Spy_Visitor v = test_parse_and_visit_module(u8"type A =\n[T];"_sv, no_diags, typescript_options); EXPECT_THAT(v.visits, ElementsAreArray({ - "visit_variable_declaration", // A - "visit_enter_type_alias_scope", // - "visit_variable_type_use", // T - "visit_exit_type_alias_scope", // - "visit_end_of_module", // + "visit_variable_declaration", // A + "visit_enter_type_scope", // + "visit_variable_type_use", // T + "visit_exit_type_scope", // + "visit_end_of_module", // })); } @@ -1965,11 +1965,11 @@ TEST_F(Test_Parse_TypeScript_Type, newline_is_allowed_before_tuple_type) { Spy_Visitor v = test_parse_and_visit_module(u8"type A = readonly\n[T];"_sv, no_diags, typescript_options); EXPECT_THAT(v.visits, ElementsAreArray({ - "visit_variable_declaration", // A - "visit_enter_type_alias_scope", // - "visit_variable_type_use", // T - "visit_exit_type_alias_scope", // - "visit_end_of_module", // + "visit_variable_declaration", // A + "visit_enter_type_scope", // + "visit_variable_type_use", // T + "visit_exit_type_scope", // + "visit_end_of_module", // })); } }