diff --git a/include/ast/expression/FunctionDeclarationExpression.hpp b/include/ast/expression/FunctionDeclarationExpression.hpp index 5c486f8..7ea41d1 100644 --- a/include/ast/expression/FunctionDeclarationExpression.hpp +++ b/include/ast/expression/FunctionDeclarationExpression.hpp @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -28,13 +29,13 @@ class FunctionDeclarationExpression : public ASTNode { private: - std::vector parameters; + std::vector> parameters; std::unique_ptr body; public: explicit FunctionDeclarationExpression( std::unique_ptr _address, - std::vector _parameters, + std::vector> _parameters, std::unique_ptr _body ) : parameters(std::move(_parameters)), body(std::move(_body)) { diff --git a/src/ast/expression/FunctionDeclarationExpression.cpp b/src/ast/expression/FunctionDeclarationExpression.cpp index 18405fd..6a90553 100644 --- a/src/ast/expression/FunctionDeclarationExpression.cpp +++ b/src/ast/expression/FunctionDeclarationExpression.cpp @@ -44,7 +44,7 @@ DynamicObject FunctionDeclarationExpression::call(SymbolTable& symbols, const st SymbolTable localSymbols(&symbols); for(size_t i = 0; i < args.size(); ++i) { auto obj = std::move(&std::move(args).at(i)); - localSymbols.setSymbol(this->parameters[i], obj); + localSymbols.setSymbol(this->parameters[i]->getImage(), obj); } return std::move(this->body->visit(localSymbols));