summaryrefslogtreecommitdiffstats
path: root/Sencha-lang/AST/ConstantExpression.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Sencha-lang/AST/ConstantExpression.cpp')
-rw-r--r--Sencha-lang/AST/ConstantExpression.cpp26
1 files changed, 1 insertions, 25 deletions
diff --git a/Sencha-lang/AST/ConstantExpression.cpp b/Sencha-lang/AST/ConstantExpression.cpp
index 25a3889..64b84ba 100644
--- a/Sencha-lang/AST/ConstantExpression.cpp
+++ b/Sencha-lang/AST/ConstantExpression.cpp
@@ -10,47 +10,26 @@
ConstantExpression::ConstantExpression(ASTNode * parent) {
this->parent = parent;
value = SenchaObject();
- this->context = NULL;
}
ConstantExpression::~ConstantExpression() {
- // Do nothing
-}
-ConstantExpression::ConstantExpression(ASTNode * parent, SenchaObject value, std::string name)
-{
- this->parent = parent;
- this->value = value;
- this->value.name = name;
- this->context = NULL;
-}
-
-ConstantExpression::ConstantExpression(ASTNode * parent, SenchaObject value, Context * context)
-{
- this->context = context;
- this->parent = parent;
- this->value = value;
}
ConstantExpression::ConstantExpression(ASTNode * parent, SenchaObject value)
{
this->parent = parent;
this->value = value;
- this->context = NULL;
}
SenchaObject ConstantExpression::evaluate()
{
- if(value.name != "" && context != NULL)
- {
- return context->get(value.name);
- }
return value;
}
void ConstantExpression::execute()
{
- std::cout << evaluate().repr() << std::endl;//Do nothing
+ std::cout << evaluate().repr() << std::endl;
}
void ConstantExpression::execute_quietly()
@@ -62,20 +41,17 @@ void ConstantExpression::execute_quietly()
ConstantExpression::ConstantExpression(ASTNode * parent, int number)
{
this->parent = parent; value = SenchaObject(number);
- this->context = NULL;
}
ConstantExpression::ConstantExpression(ASTNode * parent, double number)
{
this->parent = parent;
value = SenchaObject(number);
- this->context = NULL;
}
ConstantExpression::ConstantExpression(ASTNode * parent, std::string text)
{
this->parent = parent; value = SenchaObject(text);
- this->context = NULL;
}
std::string ConstantExpression::debug() { return "Constant expression:\n" + value.repr() + "\n"; }