}
$grammar->addGrammar(new $class($match[1]));
$cursor += strlen($match[0]);
- } elseif (preg_match('/(\w+)/A', $str, $match, null, $cursor)) {
+ } elseif (preg_match('/(\w+|,)/A', $str, $match, null, $cursor)) {
$grammar->addGrammar(new Twig_Grammar_Constant($match[1]));
$cursor += strlen($match[0]);
} elseif (preg_match('/\[/A', $str, $match, null, $cursor)) {
)
)
)),
+ array('<expr:expression> [with <arguments:array> [, <optional:expression>]]', new Twig_Grammar_Tag(
+ new Twig_Grammar_Expression('expr'),
+ new Twig_Grammar_Optional(
+ new Twig_Grammar_Constant('with'),
+ new Twig_Grammar_Array('arguments'),
+ new Twig_Grammar_Optional(
+ new Twig_Grammar_Constant(','),
+ new Twig_Grammar_Expression('optional')
+ )
+ )
+ )),
);
}
}