summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2011-09-29 23:29:13 +0200
committerKevin Chabowski <kevin@kch42.de>2011-09-29 23:29:13 +0200
commitf66cf42d751e9000c2d9593f933668989c24d0a2 (patch)
tree504ed4df858390968dc2dea0fd884437f86b862c
parent9b8a50224bd9ebd1f37e7cf969d61e4a8edd0417 (diff)
downloadste-f66cf42d751e9000c2d9593f933668989c24d0a2.tar.gz
ste-f66cf42d751e9000c2d9593f933668989c24d0a2.tar.bz2
ste-f66cf42d751e9000c2d9593f933668989c24d0a2.zip
Fixed *very* stupid bug in ste:for subcompiler.
The result of this bug: every for-loop, where the step parameter could be evaluated at compile time (i.e. only text) had step = 1. Should have seen this in the example pages...
-rw-r--r--stupid_template_engine.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/stupid_template_engine.php b/stupid_template_engine.php
index 860067b..e55023d 100644
--- a/stupid_template_engine.php
+++ b/stupid_template_engine.php
@@ -607,7 +607,7 @@ $ste_builtins = array(
if(empty($ast->params["step"]))
$step = 1;
else if((count($ast->params["step"]) == 1) and ($ast->params["step"][0] instanceof TextNode))
- $step = $ast->params["step"][0] + 0;
+ $step = $ast->params["step"][0]->text + 0;
else
$code .= "\$${loopname}_step = " . _transcompile($ast->params["step"], True) . ";\n";