aboutsummaryrefslogtreecommitdiffstats
path: root/Visitor/Interpreter.php
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2013-11-05 10:02:48 +0100
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2013-11-05 15:35:27 +0100
commit750cdea1d3476eaa8b2b5014ed78ec40d22e3a0a (patch)
treeb1dc5b6415c518716dfad6c6e291217968731e0c /Visitor/Interpreter.php
parent88fb5a499ce18d537c275c2abfd79c34ca91f112 (diff)
downloadPraspel-750cdea1d3476eaa8b2b5014ed78ec40d22e3a0a.zip
Praspel-750cdea1d3476eaa8b2b5014ed78ec40d22e3a0a.tar.gz
Praspel-750cdea1d3476eaa8b2b5014ed78ec40d22e3a0a.tar.bz2
Support $this.
Create the sub-library `Hoa\Praspel\AssertionChecker` and introduce $this support through “implicit variables”.
Diffstat (limited to 'Visitor/Interpreter.php')
-rw-r--r--Visitor/Interpreter.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/Visitor/Interpreter.php b/Visitor/Interpreter.php
index fb05dad..d043245 100644
--- a/Visitor/Interpreter.php
+++ b/Visitor/Interpreter.php
@@ -420,6 +420,9 @@ class Interpreter implements \Hoa\Visitor\Visit {
case '#this_identifier':
$identifier = 'this';
+ if(0 === $element->getChildrenNumber())
+ return $this->_root->getImplicitVariable('this');
+
foreach($element->getChildren() as $child)
$identifier .= '->' . $child->accept($this, $handle, $eldnah);