Nested function calls

This commit is contained in:
Adam Chetverkin 2013-11-25 14:04:49 +04:00
parent 40bacf1dc5
commit 62830ff3bc

View File

@ -733,7 +733,6 @@ class Template extends Render
throw new \LogicException("Forbidden to call methods");
}
$code .= $this->parseArgs($tokens);
// Kludge for nesting object calls
while($tokens->is(T_OBJECT_OPERATOR))
{
$tokens->next();
@ -742,12 +741,11 @@ class Template extends Render
throw new \LogicException('Expected function name, but got "'.$tokens->current().'"');
}
$code .= '->' . $tokens->getAndNext();
if(!$tokens->is("("))
if($tokens->is("("))
{
throw new \LogicException('Expected token "(", but got "'.$tokens->current().'"');
}
$code .= $this->parseArgs($tokens);
}
}
} elseif ($tokens->is(Tokenizer::MACRO_INCDEC)) {
$code .= $tokens->getAndNext();
} else {