summaryrefslogtreecommitdiffstats
path: root/Sencha-lang/AST/Assignment.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Sencha-lang/AST/Assignment.cpp')
-rw-r--r--Sencha-lang/AST/Assignment.cpp34
1 files changed, 4 insertions, 30 deletions
diff --git a/Sencha-lang/AST/Assignment.cpp b/Sencha-lang/AST/Assignment.cpp
index 1e98070..a74d166 100644
--- a/Sencha-lang/AST/Assignment.cpp
+++ b/Sencha-lang/AST/Assignment.cpp
@@ -12,10 +12,6 @@ SenchaObject Assignment::evaluate()
return static_cast<ASTExpression *>(children[1])->evaluate();
}
-void Assignment::set_name(std::string name)
-{
- this->name = name;
-}
void Assignment::execute()
{
@@ -38,37 +34,15 @@ void Assignment::execute_quietly()
{
context->set(left_value.name, right_value);
}
-
}
-void Assignment::add_lvalue(ASTExpression * left)
-{
- if(children.size()==0)
- children.push_back(left);
- else
- children[0] = left;
-}
-
-void Assignment::add_rvalue(ASTExpression * right)
-{
- if(children.size()==1)
- children.push_back(right);
- else if(children.size()>1)
- children[1] = right;
-
-}
-
-std::string Assignment::debug()
-{
- std::string debug_note = static_cast<ASTExpression *>(children[0])->evaluate().repr();
- debug_note += " = " + static_cast<ASTExpression *>(children[1])->evaluate().repr() + "\n";
- return debug_note;
-}
-
-Assignment::Assignment(Context * context)
+Assignment::Assignment(Context * context, std::string name, ASTExpression * left, ASTExpression * right)
{
this->context = context;
this->type = "Assignment";
+ this->children.push_back(left);
+ this->children.push_back(right);
+ this->name = name;
}