This commit is contained in:
Ivan Shalganov
2013-12-01 19:30:09 +04:00
parent 0b192c8399
commit 1ce0315282
4 changed files with 44 additions and 2 deletions

View File

@ -725,7 +725,14 @@ class Template extends Render
if ($this->_options & Fenom::DENY_METHODS) {
throw new \LogicException("Forbidden to call methods");
}
$code .= $this->parseArgs($tokens);
do { // parse call-chunks: $var->func()->func()->prop->func()->...
if($tokens->is('(')) {
$code .= $this->parseArgs($tokens);
}
if($tokens->is(T_OBJECT_OPERATOR) && $tokens->isNext(T_STRING)) {
$code .= '->'.$tokens->next()->getAndNext();
}
} while($tokens->is('(', T_OBJECT_OPERATOR));
} elseif ($tokens->is(Tokenizer::MACRO_INCDEC)) {
$code .= $tokens->getAndNext();
} else {