Commit 66070b49 by Seldaek

* Fix single line comments

git-svn-id: svn://dwoo.org/dwoo/trunk@105 0598d79b-80c4-4d41-97ba-ac86fbbd088b
parent 1c727de8
......@@ -102,11 +102,11 @@ class Dwoo_Plugin_for extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Bloc
if ($usesLast) {
$out .= "\n\t\t".'$_for'.$cnt.'_glob["last"] = (string) ($_for'.$cnt.'_glob["iteration"] === $_for'.$cnt.'_glob["total"]);';
}
$out .= "\n// -- for start output\n".Dwoo_Compiler::PHP_CLOSE;
$out .= "\n/* -- for start output */\n".Dwoo_Compiler::PHP_CLOSE;
// build post processing output and cache it
$postOut = Dwoo_Compiler::PHP_OPEN . '// -- for end output';
$postOut = Dwoo_Compiler::PHP_OPEN . '/* -- for end output */';
// update properties
if ($usesIteration) {
$postOut.="\n\t\t".'$_for'.$cnt.'_glob["iteration"]+=1;';
......
......@@ -61,7 +61,7 @@ class Dwoo_Plugin_foreach extends Dwoo_Block_Plugin implements Dwoo_ICompilable_
throw new Dwoo_Compilation_Exception($compiler, 'Foreach <em>item</em> parameter missing');
}
$name = $params['name'];
if (substr($val, 0, 1) !== '"' && substr($val, 0, 1) !== '\'') {
throw new Dwoo_Compilation_Exception($compiler, 'Foreach <em>item</em> parameter must be of type string');
}
......@@ -114,16 +114,16 @@ class Dwoo_Plugin_foreach extends Dwoo_Block_Plugin implements Dwoo_ICompilable_
if ($usesLast) {
$out .= "\n\t\t".'$_fh'.$cnt.'_glob["last"] = (string) ($_fh'.$cnt.'_glob["iteration"] === $_fh'.$cnt.'_glob["total"]);';
}
$out .= "\n// -- foreach start output\n".Dwoo_Compiler::PHP_CLOSE;
$out .= "\n/* -- foreach start output */\n".Dwoo_Compiler::PHP_CLOSE;
// build post processing output and cache it
$postOut = Dwoo_Compiler::PHP_OPEN . "\n";
if (isset($implode)) {
$postOut .= '// -- implode'."\n".'if (!$_fh'.$cnt.'_glob["last"]) {'.
$postOut .= '/* -- implode */'."\n".'if (!$_fh'.$cnt.'_glob["last"]) {'.
"\n\t".'echo '.$implode.";\n}\n";
}
$postOut .= '// -- foreach end output';
$postOut .= '/* -- foreach end output */';
// update properties
if ($usesIndex) {
$postOut.="\n\t\t".'$_fh'.$cnt.'_glob["index"]+=1;';
......
......@@ -98,10 +98,10 @@ class Dwoo_Plugin_loop extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Blo
if ($usesLast) {
$out .= "\n\t\t".'$_loop'.$cnt.'_glob["last"] = (string) ($_loop'.$cnt.'_glob["iteration"] === $_loop'.$cnt.'_glob["total"]);';
}
$out .= "\n\t\t".'$_loop'.$cnt.'_scope = $this->setScope(array("-loop-"));' . "\n// -- loop start output\n".Dwoo_Compiler::PHP_CLOSE;
$out .= "\n\t\t".'$_loop'.$cnt.'_scope = $this->setScope(array("-loop-"));' . "\n/* -- loop start output */\n".Dwoo_Compiler::PHP_CLOSE;
// build post processing output and cache it
$postOut = Dwoo_Compiler::PHP_OPEN . "\n".'// -- loop end output'."\n\t\t".'$this->setScope($_loop'.$cnt.'_scope, true);';
$postOut = Dwoo_Compiler::PHP_OPEN . "\n".'/* -- loop end output */'."\n\t\t".'$this->setScope($_loop'.$cnt.'_scope, true);';
// update properties
if ($usesIndex) {
$postOut.="\n\t\t".'$_loop'.$cnt.'_glob["index"]+=1;';
......
......@@ -59,9 +59,9 @@ class Dwoo_Plugin_with extends Dwoo_Block_Plugin implements Dwoo_ICompilable_Blo
$compiler->setScope($rparams['var']);
$params =& $compiler->getCurrentBlock();
$params['params']['postOutput'] = Dwoo_Compiler::PHP_OPEN."\n// -- end with output\n".'$this->setScope($_with'.(self::$cnt).', true);'."\n}\n".Dwoo_Compiler::PHP_CLOSE;
$params['params']['postOutput'] = Dwoo_Compiler::PHP_OPEN."\n/* -- end with output */\n".'$this->setScope($_with'.(self::$cnt).', true);'."\n}\n".Dwoo_Compiler::PHP_CLOSE;
return Dwoo_Compiler::PHP_OPEN.'if ('.$cparams['var'].')'."\n{\n".'$_with'.(self::$cnt++).' = $this->setScope("'.$rparams['var'].'");'."\n// -- start with output\n".Dwoo_Compiler::PHP_CLOSE;
return Dwoo_Compiler::PHP_OPEN.'if ('.$cparams['var'].')'."\n{\n".'$_with'.(self::$cnt++).' = $this->setScope("'.$rparams['var'].'");'."\n/* -- start with output */\n".Dwoo_Compiler::PHP_CLOSE;
}
public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content)
......
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