aboutsummaryrefslogtreecommitdiffstats
path: root/Visitor/Interpreter.php
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2013-11-10 15:38:53 +0100
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2013-11-10 15:38:53 +0100
commit09b88c57d1b5b02973a3c23f3096924679b5c7a6 (patch)
tree5561e9d77860bdec2993de038b1537158bddbf69 /Visitor/Interpreter.php
parent31d2496e677ef15956093e87b05ac3e9401ac716 (diff)
downloadPraspel-09b88c57d1b5b02973a3c23f3096924679b5c7a6.zip
Praspel-09b88c57d1b5b02973a3c23f3096924679b5c7a6.tar.gz
Praspel-09b88c57d1b5b02973a3c23f3096924679b5c7a6.tar.bz2
New `this` support.
We no longer have a `#this_identifier` node, but a more generic one: `#dynamic_resolution` (the root can be anything).
Diffstat (limited to 'Visitor/Interpreter.php')
-rw-r--r--Visitor/Interpreter.php13
1 files changed, 5 insertions, 8 deletions
diff --git a/Visitor/Interpreter.php b/Visitor/Interpreter.php
index d043245..6d70df8 100644
--- a/Visitor/Interpreter.php
+++ b/Visitor/Interpreter.php
@@ -417,14 +417,8 @@ class Interpreter implements \Hoa\Visitor\Visit {
return $variable;
break;
- 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);
+ case '#dynamic_resolution':
+ $identifier = $element->getChild(0)->accept($this, $handle, $eldnah);
return $identifier;
break;
@@ -494,6 +488,9 @@ class Interpreter implements \Hoa\Visitor\Visit {
return $value;
+ case 'this':
+ return $this->_root->getImplicitVariable('this');
+
case 'content':
case 'pure':
case 'result':