summaryrefslogtreecommitdiffstats
path: root/Sencha-lang/AST/VariableExpression.cpp
diff options
context:
space:
mode:
authorJustyna Ilczuk <justyna.ilczuk@gmail.com>2012-12-31 17:10:37 +0100
committerJustyna Ilczuk <justyna.ilczuk@gmail.com>2012-12-31 17:10:37 +0100
commit6296524bec2e2254f816b944ecc8cf28686f1fa8 (patch)
tree69b4f25c77502cd4fbcd14c28a9ad04aac28acd3 /Sencha-lang/AST/VariableExpression.cpp
parente01bc95615b24e8e122942f3701b6b4197ec16b7 (diff)
downloadsencha-lang-6296524bec2e2254f816b944ecc8cf28686f1fa8.tar.gz
sencha-lang-6296524bec2e2254f816b944ecc8cf28686f1fa8.tar.bz2
sencha-lang-6296524bec2e2254f816b944ecc8cf28686f1fa8.tar.xz
sencha-lang-6296524bec2e2254f816b944ecc8cf28686f1fa8.zip
Functions work if given right arguments ^^.
Diffstat (limited to 'Sencha-lang/AST/VariableExpression.cpp')
-rw-r--r--Sencha-lang/AST/VariableExpression.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/Sencha-lang/AST/VariableExpression.cpp b/Sencha-lang/AST/VariableExpression.cpp
index 5ab8951..895e131 100644
--- a/Sencha-lang/AST/VariableExpression.cpp
+++ b/Sencha-lang/AST/VariableExpression.cpp
@@ -7,9 +7,10 @@
#include "VariableExpression.h"
-VariableExpression::VariableExpression(std::string name, ContextManager * context) {
+VariableExpression::VariableExpression(std::string name, ContextManager * context_manager) {
this->name = name;
- this->context = context;
+ this->name_of_context = "global";
+ this->context_manager = context_manager;
this->type = "VariableExpression";
}
@@ -19,17 +20,15 @@ VariableExpression::~VariableExpression() {
SenchaObject VariableExpression::evaluate()
{
+ auto context = context_manager->get_top();
SenchaObject result = context->get(name);
result.name = name;
return result;
}
-void VariableExpression::execute()
+SenchaObject VariableExpression::execute()
{
- std::cout << evaluate().repr() << std::endl;
+ SenchaObject result = evaluate();
+ return result;
}
-void VariableExpression::execute_quietly()
-{
- evaluate();
-}