Commit cacec94b by Seldaek

* Fixes {foo()->Bar}

git-svn-id: svn://dwoo.org/dwoo/trunk@135 0598d79b-80c4-4d41-97ba-ac86fbbd088b
parent 2d656f46
...@@ -1192,7 +1192,7 @@ class Dwoo_Compiler implements Dwoo_ICompiler ...@@ -1192,7 +1192,7 @@ class Dwoo_Compiler implements Dwoo_ICompiler
} }
} }
if (isset($parsed) && $parsed==='func' && preg_match('#^->[a-z0-9_]+(\s*\(.+)?#s', $substr, $match)) { if (isset($parsed) && $parsed==='func' && preg_match('#^->[a-z0-9_]+(\s*\(.+)?#is', $substr, $match)) {
$ptr = 0; $ptr = 0;
if (is_array($parsingParams)) { if (is_array($parsingParams)) {
......
...@@ -538,12 +538,12 @@ replace="BAR" ...@@ -538,12 +538,12 @@ replace="BAR"
public function testFunctionCallsChaining() public function testFunctionCallsChaining()
{ {
$tpl = new Dwoo_Template_String('{getobj()->foo()->bar("hoy")}'); $tpl = new Dwoo_Template_String('{getobj()->foo()->Bar("hoy") getobj()->moo}');
$tpl->forceCompilation(); $tpl->forceCompilation();
$dwoo = new Dwoo(); $dwoo = new Dwoo();
$dwoo->addPlugin('getobj', array(new PluginHelper(), 'call')); $dwoo->addPlugin('getobj', array(new PluginHelper(), 'call'));
$this->assertEquals('HOY', $dwoo->get($tpl, array(), $this->compiler)); $this->assertEquals('HOYyay', $dwoo->get($tpl, array(), $this->compiler));
} }
public function testPluginProxy() public function testPluginProxy()
...@@ -583,6 +583,8 @@ class ProxyHelper implements Dwoo_IPluginProxy ...@@ -583,6 +583,8 @@ class ProxyHelper implements Dwoo_IPluginProxy
class PluginHelper class PluginHelper
{ {
public $moo = "yay";
public function callWithDwoo(Dwoo $dwoo) public function callWithDwoo(Dwoo $dwoo)
{ {
return $this; return $this;
...@@ -598,7 +600,7 @@ class PluginHelper ...@@ -598,7 +600,7 @@ class PluginHelper
return $this; return $this;
} }
public function bar($a) public function Bar($a)
{ {
return strtoupper($a); return strtoupper($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