mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Fix ternary operator
This commit is contained in:
@ -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 . ')';
|
||||
|
Reference in New Issue
Block a user