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.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/Sencha-lang/AST/Assignment.cpp b/Sencha-lang/AST/Assignment.cpp
index 9925475..05f5bc5 100644
--- a/Sencha-lang/AST/Assignment.cpp
+++ b/Sencha-lang/AST/Assignment.cpp
@@ -16,6 +16,7 @@ void Assignment::execute()
{
auto left_value = static_cast<ASTExpression *>(children[0])->evaluate();
auto right_value = static_cast<ASTExpression *>(children[1])->evaluate();
+ static_cast<ASTExpression *>(children[1])->execute_quietly();
if(left_value.name != "")
{
right_value.name = left_value.name;
@@ -24,6 +25,19 @@ void Assignment::execute()
std::cout << right_value.repr() << std::endl;
}
+void Assignment::execute_quietly()
+{
+ auto left_value = static_cast<ASTExpression *>(children[0])->evaluate();
+ auto right_value = static_cast<ASTExpression *>(children[1])->evaluate();
+ static_cast<ASTExpression *>(children[1])->execute_quietly();
+ if(left_value.name != "")
+ {
+ right_value.name = left_value.name;
+ context->set(left_value.name, right_value);
+ }
+
+}
+
void Assignment::add_lvalue(ASTExpression * left)
{
if(children.size()==0)