Website Summary Files Commits Branches @commit @diff @stats
path: root / JSImpl / src / ASTInterpreter.cpp
diff options
context:
space:
mode:
Commit6ba49b30cf1e33fb0dd6782a404ec34b7964cb59 (patch)
Author
 Martin Dobrev <martindobrev0@gmail.com>
2020-11-24 18:06:26 +0200
Committer
 GitHub <noreply@github.com>
2020-11-24 18:06:26 +0200
Filesa89b314c4d0b942d2350b9adbd741d6fa3375bfb /JSImpl/src/ASTInterpreter.cpp
IPL-6ba49b30cf1e33fb0dd6782a404ec34b7964cb59.tar
IPL-6ba49b30cf1e33fb0dd6782a404ec34b7964cb59.tar.gz
IPL-6ba49b30cf1e33fb0dd6782a404ec34b7964cb59.zip
Parent4e883334a14ff22f12765204d6bf223d07c0298f (diff)
Feature/object getters (#101)
* Add member access expression. * Implement property getters. * Add test for property getters. * Add test for property setter. * Implement while and do-while Signed-off-by: Martin Dobrev <martindobrev0@gmail.com> * Add implement byte code generation for break/continue in for/while.
1 files changed, 7 insertions, 2 deletions
-rw-r--r--JSImpl/src/ASTInterpreter.cpp9
diff --git a/JSImpl/src/ASTInterpreter.cpp b/JSImpl/src/ASTInterpreter.cpp
index f550da9..f56706a 100644
--- a/JSImpl/src/ASTInterpreter.cpp
+++ b/JSImpl/src/ASTInterpreter.cpp
@@ -240,6 +240,7 @@ public:
}
virtual void Visit(IdentifierExpression* e) override { m_LValue = m_Interpreter->ModifyVariable(e->GetName()); }
+ virtual void Visit(Call* e) override { e->GetObjectOrCall()->Accept(*this); }
ASTInterpreter* m_Interpreter;
ASTInterpreter::ValuePtr m_LValue;
@@ -565,9 +566,13 @@ void ASTInterpreter::Visit(EmptyExpression* e) {
NOT_IMPLEMENTED;
}
-void ASTInterpreter::Visit(CallExpression* e)
+void ASTInterpreter::Visit(Call* e)
{
- NOT_IMPLEMENTED;
+ e->GetObjectOrCall()->Accept(*this);
+ if (e->GetMember())
+ {
+ e->GetMember()->Accept(*this);
+ }
}
void ASTInterpreter::Print(Printer& p)