Commit 8eb1d240 by seldaek

Fixed a parsing bug with method calls used as arguments with a comma following.

git-svn-id: http://svn.dwoo.org/trunk@339 0598d79b-80c4-4d41-97ba-ac86fbbd088b
parent a91a53f9
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
* Fixed parsing of quoted keywords in if statements, like 'not' was * Fixed parsing of quoted keywords in if statements, like 'not' was
parsed as ! because using {if not $foo} is valid, but it was impossible parsed as ! because using {if not $foo} is valid, but it was impossible
to use them even as string. to use them even as string.
* Fixed parsing bug with method calls used as arguments with a comma
following.
[2010-02-07] 1.1.1 [2010-02-07] 1.1.1
+ Added {optional} plugin that just prints an optional var without any + Added {optional} plugin that just prints an optional var without any
......
...@@ -2258,7 +2258,7 @@ class Dwoo_Compiler implements Dwoo_ICompiler ...@@ -2258,7 +2258,7 @@ class Dwoo_Compiler implements Dwoo_ICompiler
$ptr += 2; $ptr += 2;
} }
if (in_array($methodCall[$ptr], array(';', '/', ' ', "\t", "\r", "\n", ')', '+', '*', '%', '=', '-', '|')) || substr($methodCall, $ptr, strlen($this->rd)) === $this->rd) { if (in_array($methodCall[$ptr], array(';', ',', '/', ' ', "\t", "\r", "\n", ')', '+', '*', '%', '=', '-', '|')) || substr($methodCall, $ptr, strlen($this->rd)) === $this->rd) {
// break char found // break char found
break; break;
} }
......
...@@ -696,6 +696,13 @@ fail ...@@ -696,6 +696,13 @@ fail
$tpl->forceCompilation(); $tpl->forceCompilation();
$this->assertEquals('', trim($this->dwoo->get($tpl, array(), $this->compiler))); $this->assertEquals('', trim($this->dwoo->get($tpl, array(), $this->compiler)));
} }
public function testParsingOfMethodWithFollowingArgs()
{
$tpl = new Dwoo_Template_String('{lower cat($obj->Bar("test"), "TEST")}');
$tpl->forceCompilation();
$this->assertEquals('testtest', $this->dwoo->get($tpl, array('obj'=>new PluginHelper()), $this->compiler));
}
} }
function excessArgsHelper($a) { function excessArgsHelper($a) {
......
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