Commit 257cdab5 by Seldaek

* Fixed compiler bug that created a parse error when you had comments in an extended template

git-svn-id: svn://dwoo.org/dwoo/trunk@144 0598d79b-80c4-4d41-97ba-ac86fbbd088b
parent 39f1bcf1
[2008-0-] 0.9.4 / 1.0.0 ?
* Fixed compiler bug that created a parse error when you had comments in an
extended template
[2008-08-03] 0.9.3
+ Adapters: Added the ZendFramework interface for Dwoo
(see /Dwoo/Adapters/ZendFramework/README)
+ Plugins: Added the {a} block plugin to generate <a> tags
+ Syntax: Added the ";" token that allows to group multiple instructions in one
single template tag, example: {if $foo; "> $foo";$bar;/} is equal to:
......
......@@ -562,7 +562,23 @@ class Dwoo_Compiler implements Dwoo_ICompiler
$this->templateSource =& $tpl;
$this->pointer =& $ptr;
if ($this->debug) echo 'PROCESSING PREPROCESSORS<br>';
while (true) {
// if pointer is at the beginning, reset everything, that allows a plugin to externally reset the compiler if everything must be reparsed
if ($ptr===0) {
// resets variables
$this->usedPlugins = array();
$this->data = array();
$this->scope =& $this->data;
$this->scopeTree = array();
$this->stack = array();
$this->line = 1;
// add top level block
$compiled = $this->addBlock('topLevelBlock', array(), 0);
$this->stack[0]['buffer'] = '';
if ($this->debug) echo 'COMPILER INIT<br />';
if ($this->debug) echo 'PROCESSING PREPROCESSORS ('.count($this->processors['pre']).')<br>';
// runs preprocessors
foreach ($this->processors['pre'] as $preProc) {
......@@ -577,6 +593,7 @@ class Dwoo_Compiler implements Dwoo_ICompiler
}
unset($preProc);
// show template source if debug
if ($this->debug) echo '<pre>'.print_r(htmlentities($tpl), true).'</pre><hr />';
// strips comments
......@@ -602,21 +619,6 @@ class Dwoo_Compiler implements Dwoo_ICompiler
}
}
while (true) {
// if pointer is at the beginning, reset everything, that allows a plugin to externally reset the compiler if everything must be reparsed
if ($ptr===0) {
// resets variables
$this->usedPlugins = array();
$this->data = array();
$this->scope =& $this->data;
$this->scopeTree = array();
$this->stack = array();
$this->line = 1;
// add top level block
$compiled = $this->addBlock('topLevelBlock', array(), 0);
$this->stack[0]['buffer'] = '';
if ($this->debug) echo 'COMPILER INIT<br />';
}
$pos = strpos($tpl, $this->ld, $ptr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment