From 03918b036dafe5cd4a2cf6b88176acd6ff1fa758 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Tue, 4 Apr 2023 22:49:21 +0200 Subject: [PATCH] AST: Rename function addElement -> add --- src/ast.cpp | 2 +- src/ast.h | 2 +- src/eval.cpp | 2 +- src/reader.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ast.cpp b/src/ast.cpp index 53232ad..a891168 100644 --- a/src/ast.cpp +++ b/src/ast.cpp @@ -23,7 +23,7 @@ void Collection::add(ASTNodePtr node) // ----------------------------------------- -void HashMap::addElement(const std::string& key, ASTNodePtr value) +void HashMap::add(const std::string& key, ASTNodePtr value) { m_elements.emplace(key, value); } diff --git a/src/ast.h b/src/ast.h index 43febdb..27fbe53 100644 --- a/src/ast.h +++ b/src/ast.h @@ -101,7 +101,7 @@ public: virtual bool isHashMap() const override { return true; } - void addElement(const std::string& key, ASTNodePtr value); + void add(const std::string& key, ASTNodePtr value); const std::unordered_map& elements() const { return m_elements; } size_t size() const { return m_elements.size(); } diff --git a/src/eval.cpp b/src/eval.cpp index b01d3aa..b810cf6 100644 --- a/src/eval.cpp +++ b/src/eval.cpp @@ -157,7 +157,7 @@ ASTNodePtr Eval::evalAst(ASTNodePtr ast, EnvironmentPtr env) if (element_node == nullptr) { return nullptr; } - result->addElement(element.first, element_node); + result->add(element.first, element_node); } return result; } diff --git a/src/reader.cpp b/src/reader.cpp index 101a32a..3ffcee1 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -197,7 +197,7 @@ ASTNodePtr Reader::readHashMap() } std::string keyString = is(key.get()) ? std::static_pointer_cast(key)->data() : std::static_pointer_cast(key)->keyword(); - hash_map->addElement(keyString, value); + hash_map->add(keyString, value); } if (!consumeSpecific(Token { .type = Token::Type::BraceClose })) { // }