5 function generator($compiler, $args)
7 if (count($args) > 1) {
8 if (!isset($args[1]['string'])) {
9 throw new Haanga_CompilerException("pluralize: First parameter must be an string");
11 $parts = explode(",", $args[1]['string']);
13 if (count($parts) == 1) {
16 $singular = $parts[0];
24 return $compiler->expr_cond(
25 $compiler->expr("<=", $args[0], 1),
26 $compiler->expr_str($singular),
27 $compiler->expr_str($plural)