aboutsummaryrefslogtreecommitdiffstats
path: root/Visitor
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2013-09-27 11:39:51 +0200
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2013-09-27 11:39:51 +0200
commit586a8d07ccee20fe3c31c9d990b58bb713ce6753 (patch)
tree38c017bcfa88517db51b55a17caf24582bd5fffa /Visitor
parent217a269fc02fbbcd1e2c33d04369dda5e4b44cc2 (diff)
downloadPraspel-586a8d07ccee20fe3c31c9d990b58bb713ce6753.zip
Praspel-586a8d07ccee20fe3c31c9d990b58bb713ce6753.tar.gz
Praspel-586a8d07ccee20fe3c31c9d990b58bb713ce6753.tar.bz2
Restore “let”.
Diffstat (limited to 'Visitor')
-rw-r--r--Visitor/Compiler.php10
-rw-r--r--Visitor/Praspel.php2
2 files changed, 6 insertions, 6 deletions
diff --git a/Visitor/Compiler.php b/Visitor/Compiler.php
index 40a835d..74c06b7 100644
--- a/Visitor/Compiler.php
+++ b/Visitor/Compiler.php
@@ -106,7 +106,7 @@ class Compiler implements \Hoa\Visitor\Visit {
$variable . ' = $' . $element->getParent()->getId() .
'->getClause(\'' . $element->getName() . '\');' . "\n";
- foreach($element as $var)
+ foreach($element->getLocalVariables() as $var)
$out .= $var->accept($this, $handle, $eldnah);
foreach($element->getPredicates() as $predicate)
@@ -123,10 +123,10 @@ class Compiler implements \Hoa\Visitor\Visit {
else
$out .= $start;
- if(null === $alias = $element->getAlias())
- $out .= '->in = ' . $element->getDomains() . ';' . "\n";
- else
+ if(null !== $alias = $element->getAlias())
$out .= '->domainof(\'' . $alias . '\');' . "\n";
+ else
+ $out .= '->in = ' . $element->getDomains() . ';' . "\n";
$constraints = $element->getConstraints();
@@ -168,7 +168,7 @@ class Compiler implements \Hoa\Visitor\Visit {
$out .= '$' . $temp . ' = ' .
$variable . '->newWith();' . "\n";
- foreach($with as $var)
+ foreach($with->getLocalVariables() as $var)
$out .= $var->accept($this, $handle, $temp);
foreach($with->getPredicates() as $predicate)
diff --git a/Visitor/Praspel.php b/Visitor/Praspel.php
index 26949b9..0471ddf 100644
--- a/Visitor/Praspel.php
+++ b/Visitor/Praspel.php
@@ -102,7 +102,7 @@ class Praspel implements \Hoa\Visitor\Visit {
$out = '@' . $clause;
$oout = array();
- foreach($element as $name => $var)
+ foreach($element->getLocalVariables() as $name => $var)
$oout[] = ' ' . $var->accept($this, $handle, $eldnah);
foreach($element->getPredicates() as $predicate)