$compiler
->raw('(')
->subcompile($this->getNode('left'))
- ->raw(') ')
+ ->raw(' ')
;
$this->operator($compiler);
$compiler
- ->raw(' (')
+ ->raw(' ')
->subcompile($this->getNode('right'))
->raw(')')
;
{{ 1 or 0 }}
{{ 0 or 1 }}
{{ 0 or 0 }}
+{{ 0 or 1 and 0 }}
+{{ 1 or 0 and 1 }}
{{ "foo" ~ "bar" }}
{{ foo ~ "bar" }}
{{ "foo" ~ bar }}
1
1
+
+1
foobar
barbar
foofoo
--TEMPLATE--
{{ not 1 }}/{{ not 0 }}
{{ +1 + 1 }}/{{ -1 - 1 }}
+{{ not (false or true) }}
--DATA--
return array()
--EXPECT--
/1
2/-2
+
$node = new Twig_Node_Expression_Binary_Add($left, $right, 0);
return array(
- array($node, '(1) + (2)'),
+ array($node, '(1 + 2)'),
);
}
}
$node = new Twig_Node_Expression_Binary_And($left, $right, 0);
return array(
- array($node, '(1) && (2)'),
+ array($node, '(1 && 2)'),
);
}
}
$node = new Twig_Node_Expression_Binary_Concat($left, $right, 0);
return array(
- array($node, '(1) . (2)'),
+ array($node, '(1 . 2)'),
);
}
}
$node = new Twig_Node_Expression_Binary_Div($left, $right, 0);
return array(
- array($node, '(1) / (2)'),
+ array($node, '(1 / 2)'),
);
}
}
$node = new Twig_Node_Expression_Binary_FloorDiv($left, $right, 0);
return array(
- array($node, 'floor((1) / (2))'),
+ array($node, 'floor((1 / 2))'),
);
}
}
$node = new Twig_Node_Expression_Binary_Mod($left, $right, 0);
return array(
- array($node, '(1) % (2)'),
+ array($node, '(1 % 2)'),
);
}
}
$node = new Twig_Node_Expression_Binary_Mul($left, $right, 0);
return array(
- array($node, '(1) * (2)'),
+ array($node, '(1 * 2)'),
);
}
}
$node = new Twig_Node_Expression_Binary_Or($left, $right, 0);
return array(
- array($node, '(1) || (2)'),
+ array($node, '(1 || 2)'),
);
}
}
$node = new Twig_Node_Expression_Binary_Sub($left, $right, 0);
return array(
- array($node, '(1) - (2)'),
+ array($node, '(1 - 2)'),
);
}
}