AST: Rename function addElement -> add
This commit is contained in:
+1
-1
@@ -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);
|
m_elements.emplace(key, value);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ public:
|
|||||||
|
|
||||||
virtual bool isHashMap() const override { return true; }
|
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<std::string, ASTNodePtr>& elements() const { return m_elements; }
|
const std::unordered_map<std::string, ASTNodePtr>& elements() const { return m_elements; }
|
||||||
size_t size() const { return m_elements.size(); }
|
size_t size() const { return m_elements.size(); }
|
||||||
|
|||||||
+1
-1
@@ -157,7 +157,7 @@ ASTNodePtr Eval::evalAst(ASTNodePtr ast, EnvironmentPtr env)
|
|||||||
if (element_node == nullptr) {
|
if (element_node == nullptr) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
result->addElement(element.first, element_node);
|
result->add(element.first, element_node);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -197,7 +197,7 @@ ASTNodePtr Reader::readHashMap()
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string keyString = is<String>(key.get()) ? std::static_pointer_cast<String>(key)->data() : std::static_pointer_cast<Keyword>(key)->keyword();
|
std::string keyString = is<String>(key.get()) ? std::static_pointer_cast<String>(key)->data() : std::static_pointer_cast<Keyword>(key)->keyword();
|
||||||
hash_map->addElement(keyString, value);
|
hash_map->add(keyString, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!consumeSpecific(Token { .type = Token::Type::BraceClose })) { // }
|
if (!consumeSpecific(Token { .type = Token::Type::BraceClose })) { // }
|
||||||
|
|||||||
Reference in New Issue
Block a user