Fix ternary operator

This commit is contained in:
bzick
2013-08-02 23:01:06 +04:00
parent e51eb9f3d8
commit 43925ae640
2 changed files with 6 additions and 4 deletions

View File

@ -907,9 +907,7 @@ class Template extends Render
}
} else {
$expr1 = $this->parseExp($tokens, true);
if (!$tokens->is(":")) {
throw new UnexpectedTokenException($tokens, null, "ternary operator");
}
$tokens->need(':')->skip();
$expr2 = $this->parseExp($tokens, true);
if ($empty) {
return '(empty(' . $var . ') ? ' . $expr2 . ' : ' . $expr1 . ')';