From e5e144f59c2f47014666ef6f6e32fae7c29b854d Mon Sep 17 00:00:00 2001 From: Yingchi Long Date: Sat, 28 Sep 2024 08:37:36 +0800 Subject: [PATCH] libnixf: fix typo `Identifer` -> `Identifier` (#601) --- libnixf/include/nixf/Basic/NodeKinds.inc | 2 +- libnixf/include/nixf/Basic/Nodes/Basic.h | 2 +- libnixf/test/Basic/Nodes.cpp | 2 +- libnixf/test/Sema/ParentMap.cpp | 2 +- libnixf/test/Sema/VariableLookup.cpp | 2 +- nixd/lib/Controller/AST.cpp | 2 +- nixd/tools/nixd/test/hover/1.md | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libnixf/include/nixf/Basic/NodeKinds.inc b/libnixf/include/nixf/Basic/NodeKinds.inc index 124eaa878..dabecdb63 100644 --- a/libnixf/include/nixf/Basic/NodeKinds.inc +++ b/libnixf/include/nixf/Basic/NodeKinds.inc @@ -10,7 +10,7 @@ NODE(InterpolableParts) /// \see Misc NODE(Misc) NODE(Dot) -NODE(Identifer) +NODE(Identifier) NODE(AttrName) NODE(AttrPath) NODE(Binding) diff --git a/libnixf/include/nixf/Basic/Nodes/Basic.h b/libnixf/include/nixf/Basic/Nodes/Basic.h index 4a65686e2..23988d48b 100644 --- a/libnixf/include/nixf/Basic/Nodes/Basic.h +++ b/libnixf/include/nixf/Basic/Nodes/Basic.h @@ -116,7 +116,7 @@ class Identifier : public Node { public: Identifier(LexerCursorRange Range, std::string Name) - : Node(NK_Identifer, Range), Name(std::move(Name)) {} + : Node(NK_Identifier, Range), Name(std::move(Name)) {} [[nodiscard]] const std::string &name() const { return Name; } [[nodiscard]] ChildVector children() const override { return {}; } diff --git a/libnixf/test/Basic/Nodes.cpp b/libnixf/test/Basic/Nodes.cpp index c50be5a0c..71796fa24 100644 --- a/libnixf/test/Basic/Nodes.cpp +++ b/libnixf/test/Basic/Nodes.cpp @@ -15,7 +15,7 @@ TEST(Node, Descend) { std::vector Diag; auto Root = parse(Src, Diag); - ASSERT_EQ(Root->descend({{0, 2}, {0, 2}})->kind(), Node::NK_Identifer); + ASSERT_EQ(Root->descend({{0, 2}, {0, 2}})->kind(), Node::NK_Identifier); ASSERT_EQ(Root->descend({{0, 2}, {0, 4}})->kind(), Node::NK_Binding); } diff --git a/libnixf/test/Sema/ParentMap.cpp b/libnixf/test/Sema/ParentMap.cpp index 2a73451e5..29a31932c 100644 --- a/libnixf/test/Sema/ParentMap.cpp +++ b/libnixf/test/Sema/ParentMap.cpp @@ -19,7 +19,7 @@ TEST_F(ParentMapTest, Basic) { PMA.runOnAST(*AST); const Node *ID = AST->descend({{0, 0}, {0, 1}}); - ASSERT_EQ(ID->kind(), Node::NK_Identifer); + ASSERT_EQ(ID->kind(), Node::NK_Identifier); const Node *Var = PMA.upExpr(*ID); diff --git a/libnixf/test/Sema/VariableLookup.cpp b/libnixf/test/Sema/VariableLookup.cpp index 89e596bd5..2b1c3c48a 100644 --- a/libnixf/test/Sema/VariableLookup.cpp +++ b/libnixf/test/Sema/VariableLookup.cpp @@ -226,7 +226,7 @@ TEST_F(VLATest, ToDefLambda) { ASSERT_TRUE(AST); const Node *ID = AST->descend({{0, 1}, {0, 1}}); - ASSERT_EQ(ID->kind(), Node::NK_Identifer); + ASSERT_EQ(ID->kind(), Node::NK_Identifier); const auto *Def = VLA.toDef(*ID); ASSERT_TRUE(Def); diff --git a/nixd/lib/Controller/AST.cpp b/nixd/lib/Controller/AST.cpp index e941b1319..a8a2200f0 100644 --- a/nixd/lib/Controller/AST.cpp +++ b/nixd/lib/Controller/AST.cpp @@ -272,7 +272,7 @@ nixd::Selector nixd::idioms::mkSelector(const nixf::ExprSelect &Sel, std::pair, std::string> nixd::getScopeAndPrefix(const Node &N, const ParentMapAnalysis &PM) { - if (N.kind() != Node::NK_Identifer) + if (N.kind() != Node::NK_Identifier) return {}; // FIXME: impl scoped packages diff --git a/nixd/tools/nixd/test/hover/1.md b/nixd/tools/nixd/test/hover/1.md index 9bdd4e05b..7bc1950d5 100644 --- a/nixd/tools/nixd/test/hover/1.md +++ b/nixd/tools/nixd/test/hover/1.md @@ -61,7 +61,7 @@ CHECK-NEXT: "jsonrpc": "2.0", CHECK-NEXT: "result": { CHECK-NEXT: "contents": { CHECK-NEXT: "kind": "markdown", -CHECK-NEXT: "value": "`Identifer`" +CHECK-NEXT: "value": "`Identifier`" CHECK-NEXT: }, CHECK-NEXT: "range": { CHECK-NEXT: "end": {