---input---
From the Twig test suite, https://github.com/fabpot/Twig, available under BSD license.

--TEST--
Exception for an unclosed tag
--TEMPLATE--
{% block foo %}
     {% if foo %}




         {% for i in fo %}



         {% endfor %}



{% endblock %}
--EXCEPTION--
Twig_Error_Syntax: Unexpected tag name "endblock" (expecting closing tag for the "if" tag defined near line 4) in "index.twig" at line 16
--TEST--
Exception for an undefined trait
--TEMPLATE--
{% use 'foo' with foobar as bar %}
--TEMPLATE(foo)--
{% block bar %}
{% endblock %}
--EXCEPTION--
Twig_Error_Runtime: Block "foobar" is not defined in trait "foo" in "index.twig".
--TEST--
Twig supports method calls
--TEMPLATE--
{{ items.foo }}
{{ items['foo'] }}
{{ items[foo] }}
{{ items[items[foo]] }}
--DATA--
return array('foo' => 'bar', 'items' => array('foo' => 'bar', 'bar' => 'foo'))
--EXPECT--
bar
bar
foo
bar
--TEST--
Twig supports array notation
--TEMPLATE--
{# empty array #}
{{ []|join(',') }}

{{ [1, 2]|join(',') }}
{{ ['foo', "bar"]|join(',') }}
{{ {0: 1, 'foo': 'bar'}|join(',') }}
{{ {0: 1, 'foo': 'bar'}|keys|join(',') }}

{{ {0: 1, foo: 'bar'}|join(',') }}
{{ {0: 1, foo: 'bar'}|keys|join(',') }}

{# nested arrays #}
{% set a = [1, 2, [1, 2], {'foo': {'foo': 'bar'}}] %}
{{ a[2]|join(',') }}
{{ a[3]["foo"]|join(',') }}

{# works even if [] is used inside the array #}
{{ [foo[bar]]|join(',') }}

{# elements can be any expression #}
{{ ['foo'|upper, bar|upper, bar == foo]|join(',') }}

{# arrays can have a trailing , like in PHP #}
{{
  [
    1,
    2,
  ]|join(',')
}}

{# keys can be any expression #}
{% set a = 1 %}
{% set b = "foo" %}
{% set ary = { (a): 'a', (b): 'b', 'c': 'c', (a ~ b): 'd' } %}
{{ ary|keys|join(',') }}
{{ ary|join(',') }}
--DATA--
return array('bar' => 'bar', 'foo' => array('bar' => 'bar'))
--EXPECT--
1,2
foo,bar
1,bar
0,foo

1,bar
0,foo

1,2
bar

bar

FOO,BAR,

1,2

1,foo,c,1foo
a,b,c,d
--TEST--
Twig supports binary operations (+, -, *, /, ~, %, and, or)
--TEMPLATE--
{{ 1 + 1 }}
{{ 2 - 1 }}
{{ 2 * 2 }}
{{ 2 / 2 }}
{{ 3 % 2 }}
{{ 1 and 1 }}
{{ 1 and 0 }}
{{ 0 and 1 }}
{{ 0 and 0 }}
{{ 1 or 1 }}
{{ 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 }}
{{ foo ~ bar }}
{{ 20 // 7 }}
--DATA--
return array('foo' => 'bar', 'bar' => 'foo')
--EXPECT--
2
1
4
1
1
1



1
1
1


1
foobar
barbar
foofoo
barfoo
2
--TEST--
Twig supports bitwise operations
--TEMPLATE--
{{ 1 b-and 5 }}
{{ 1 b-or 5 }}
{{ 1 b-xor 5 }}
{{ (1 and 0 b-or 0) is same as(1 and (0 b-or 0)) ? 'ok' : 'ko' }}
--DATA--
return array()
--EXPECT--
1
5
4
ok
--TEST--
Twig supports comparison operators (==, !=, <, >, >=, <=)
--TEMPLATE--
{{ 1 > 2 }}/{{ 1 > 1 }}/{{ 1 >= 2 }}/{{ 1 >= 1 }}
{{ 1 < 2 }}/{{ 1 < 1 }}/{{ 1 <= 2 }}/{{ 1 <= 1 }}
{{ 1 == 1 }}/{{ 1 == 2 }}
{{ 1 != 1 }}/{{ 1 != 2 }}
--DATA--
return array()
--EXPECT--
///1
1//1/1
1/
/1
--TEST--
Twig supports the "divisible by" operator
--TEMPLATE--
{{ 8 is divisible by(2) ? 'OK' }}
{{ 8 is not divisible by(3) ? 'OK' }}
{{ 8 is    divisible   by   (2) ? 'OK' }}
{{ 8 is not
   divisible
   by
   (3) ? 'OK' }}
--DATA--
return array()
--EXPECT--
OK
OK
OK
OK
--TEST--
Twig supports the .. operator
--TEMPLATE--
{% for i in 0..10 %}{{ i }} {% endfor %}

{% for letter in 'a'..'z' %}{{ letter }} {% endfor %}

{% for letter in 'a'|upper..'z'|upper %}{{ letter }} {% endfor %}

{% for i in foo[0]..foo[1] %}{{ i }} {% endfor %}

{% for i in 0 + 1 .. 10 - 1 %}{{ i }} {% endfor %}
--DATA--
return array('foo' => array(1, 10))
--EXPECT--
0 1 2 3 4 5 6 7 8 9 10 
a b c d e f g h i j k l m n o p q r s t u v w x y z 
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 
1 2 3 4 5 6 7 8 9 10 
1 2 3 4 5 6 7 8 9
--TEST--
Twig supports the "ends with" operator
--TEMPLATE--
{{ 'foo' ends with 'o' ? 'OK' : 'KO' }}
{{ not ('foo' ends with 'f') ? 'OK' : 'KO' }}
{{ not ('foo' ends with 'foowaytoolong') ? 'OK' : 'KO' }}
{{ 'foo' ends with '' ? 'OK' : 'KO' }}
{{ '1' ends with true ? 'OK' : 'KO' }}
{{ 1 ends with true ? 'OK' : 'KO' }}
{{ 0 ends with false ? 'OK' : 'KO' }}
{{ '' ends with false ? 'OK' : 'KO' }}
{{ false ends with false ? 'OK' : 'KO' }}
{{ false ends with '' ? 'OK' : 'KO' }}
--DATA--
return array()
--EXPECT--
OK
OK
OK
OK
KO
KO
KO
KO
KO
KO
--TEST--
Twig supports grouping of expressions
--TEMPLATE--
{{ (2 + 2) / 2 }}
--DATA--
return array()
--EXPECT--
2
--TEST--
Twig supports literals
--TEMPLATE--
1 {{ true }}
2 {{ TRUE }}
3 {{ false }}
4 {{ FALSE }}
5 {{ none }}
6 {{ NONE }}
7 {{ null }}
8 {{ NULL }}
--DATA--
return array()
--EXPECT--
1 1
2 1
3 
4 
5 
6 
7 
8 
--TEST--
Twig supports __call() for attributes
--TEMPLATE--
{{ foo.foo }}
{{ foo.bar }}
--EXPECT--
foo_from_call
bar_from_getbar
--TEST--
Twig supports the "matches" operator
--TEMPLATE--
{{ 'foo' matches '/o/' ? 'OK' : 'KO' }}
{{ 'foo' matches '/^fo/' ? 'OK' : 'KO' }}
{{ 'foo' matches '/O/i' ? 'OK' : 'KO' }}
--DATA--
return array()
--EXPECT--
OK
OK
OK
--TEST--
Twig supports method calls
--TEMPLATE--
{{ items.foo.foo }}
{{ items.foo.getFoo() }}
{{ items.foo.bar }}
{{ items.foo['bar'] }}
{{ items.foo.bar('a', 43) }}
{{ items.foo.bar(foo) }}
{{ items.foo.self.foo() }}
{{ items.foo.is }}
{{ items.foo.in }}
{{ items.foo.not }}
--DATA--
return array('foo' => 'bar', 'items' => array('foo' => new TwigTestFoo(), 'bar' => 'foo'))
--CONFIG--
return array('strict_variables' => false)
--EXPECT--
foo
foo
bar

bar_a-43
bar_bar
foo
is
in
not
--TEST--
Twig allows to use named operators as variable names
--TEMPLATE--
{% for match in matches %}
    {{- match }}
{% endfor %}
{{ in }}
{{ is }}
--DATA--
return array('matches' => array(1, 2, 3), 'in' => 'in', 'is' => 'is')
--EXPECT--
1
2
3
in
is
--TEST--
Twig parses postfix expressions
--TEMPLATE--
{% import _self as macros %}

{% macro foo() %}foo{% endmacro %}

{{ 'a' }}
{{ 'a'|upper }}
{{ ('a')|upper }}
{{ -1|upper }}
{{ macros.foo() }}
{{ (macros).foo() }}
--DATA--
return array();
--EXPECT--
a
A
A
-1
foo
foo
--TEST--
Twig supports the "same as" operator
--TEMPLATE--
{{ 1 is same as(1) ? 'OK' }}
{{ 1 is not same as(true) ? 'OK' }}
{{ 1 is same as(1) ? 'OK' }}
{{ 1 is not same as(true) ? 'OK' }}
{{ 1 is   same    as   (1) ? 'OK' }}
{{ 1 is not
    same
    as
    (true) ? 'OK' }}
--DATA--
return array()
--EXPECT--
OK
OK
OK
OK
OK
OK
--TEST--
Twig supports the "starts with" operator
--TEMPLATE--
{{ 'foo' starts with 'f' ? 'OK' : 'KO' }}
{{ not ('foo' starts with 'oo') ? 'OK' : 'KO' }}
{{ not ('foo' starts with 'foowaytoolong') ? 'OK' : 'KO' }}
{{ 'foo' starts      with 'f' ? 'OK' : 'KO' }}
{{ 'foo' starts
with 'f' ? 'OK' : 'KO' }}
{{ 'foo' starts with '' ? 'OK' : 'KO' }}
{{ '1' starts with true ? 'OK' : 'KO' }}
{{ '' starts with false ? 'OK' : 'KO' }}
{{ 'a' starts with false ? 'OK' : 'KO' }}
{{ false starts with '' ? 'OK' : 'KO' }}
--DATA--
return array()
--EXPECT--
OK
OK
OK
OK
OK
OK
KO
KO
KO
KO
--TEST--
Twig supports string interpolation
--TEMPLATE--
{# "foo #{"foo #{bar} baz"} baz" #}
{# "foo #{bar}#{bar} baz" #}
--DATA--
return array('bar' => 'BAR');
--EXPECT--
foo foo BAR baz baz
foo BARBAR baz
--TEST--
Twig supports the ternary operator
--TEMPLATE--
{{ 1 ? 'YES' }}
{{ 0 ? 'YES' }}
--DATA--
return array()
--EXPECT--
YES

--TEST--
Twig supports the ternary operator
--TEMPLATE--
{{ 'YES' ?: 'NO' }}
{{ 0 ?: 'NO' }}
--DATA--
return array()
--EXPECT--
YES
NO
--TEST--
Twig supports the ternary operator
--TEMPLATE--
{{ 1 ? 'YES' : 'NO' }}
{{ 0 ? 'YES' : 'NO' }}
{{ 0 ? 'YES' : (1 ? 'YES1' : 'NO1') }}
{{ 0 ? 'YES' : (0 ? 'YES1' : 'NO1') }}
{{ 1 == 1 ? 'foo<br />':'' }}
{{ foo ~ (bar ? ('-' ~ bar) : '') }}
--DATA--
return array('foo' => 'foo', 'bar' => 'bar')
--EXPECT--
YES
NO
YES1
NO1
foo<br />
foo-bar
--TEST--
Twig does not allow to use two-word named operators as variable names
--TEMPLATE--
{{ starts with }}
--DATA--
return array()
--EXCEPTION--
Twig_Error_Syntax: Unexpected token "operator" of value "starts with" in "index.twig" at line 2
--TEST--
Twig unary operators precedence
--TEMPLATE--
{{ -1 - 1 }}
{{ -1 - -1 }}
{{ -1 * -1 }}
{{ 4 / -1 * 5 }}
--DATA--
return array()
--EXPECT--
-2
0
1
-20
--TEST--
Twig supports unary operators (not, -, +)
--TEMPLATE--
{{ not 1 }}/{{ not 0 }}
{{ +1 + 1 }}/{{ -1 - 1 }}
{{ not (false or true) }}
--DATA--
return array()
--EXPECT--
/1
2/-2

--TEST--
"abs" filter
--TEMPLATE--
{{ (-5.5)|abs }}
{{ (-5)|abs }}
{{ (-0)|abs }}
{{ 0|abs }}
{{ 5|abs }}
{{ 5.5|abs }}
{{ number1|abs }}
{{ number2|abs }}
{{ number3|abs }}
{{ number4|abs }}
{{ number5|abs }}
{{ number6|abs }}
--DATA--
return array('number1' => -5.5, 'number2' => -5, 'number3' => -0, 'number4' => 0, 'number5' => 5, 'number6' => 5.5)
--EXPECT--
5.5
5
0
0
5
5.5
5.5
5
0
0
5
5.5
--TEST--
"batch" filter
--TEMPLATE--
{% for row in items|batch(3.1) %}
  <div class=row>
  {% for column in row %}
    <div class=item>{{ column }}</div>
  {% endfor %}
  </div>
{% endfor %}
--DATA--
return array('items' => array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'))
--EXPECT--
<div class=row>
      <div class=item>a</div>
      <div class=item>b</div>
      <div class=item>c</div>
      <div class=item>d</div>
    </div>
  <div class=row>
      <div class=item>e</div>
      <div class=item>f</div>
      <div class=item>g</div>
      <div class=item>h</div>
    </div>
  <div class=row>
      <div class=item>i</div>
      <div class=item>j</div>
    </div>
--TEST--
"batch" filter
--TEMPLATE--
{% for row in items|batch(3) %}
  <div class=row>
  {% for column in row %}
    <div class=item>{{ column }}</div>
  {% endfor %}
  </div>
{% endfor %}
--DATA--
return array('items' => array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'))
--EXPECT--
<div class=row>
      <div class=item>a</div>
      <div class=item>b</div>
      <div class=item>c</div>
    </div>
  <div class=row>
      <div class=item>d</div>
      <div class=item>e</div>
      <div class=item>f</div>
    </div>
  <div class=row>
      <div class=item>g</div>
      <div class=item>h</div>
      <div class=item>i</div>
    </div>
  <div class=row>
      <div class=item>j</div>
    </div>
--TEST--
"batch" filter
--TEMPLATE--
<table>
{% for row in items|batch(3, '') %}
  <tr>
  {% for column in row %}
    <td>{{ column }}</td>
  {% endfor %}
  </tr>
{% endfor %}
</table>
--DATA--
return array('items' => array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'))
--EXPECT--
<table>
  <tr>
      <td>a</td>
      <td>b</td>
      <td>c</td>
    </tr>
  <tr>
      <td>d</td>
      <td>e</td>
      <td>f</td>
    </tr>
  <tr>
      <td>g</td>
      <td>h</td>
      <td>i</td>
    </tr>
  <tr>
      <td>j</td>
      <td></td>
      <td></td>
    </tr>
</table>
--TEST--
"batch" filter
--TEMPLATE--
{% for row in items|batch(3, 'fill') %}
  <div class=row>
  {% for column in row %}
    <div class=item>{{ column }}</div>
  {% endfor %}
  </div>
{% endfor %}
--DATA--
return array('items' => array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l'))
--EXPECT--
<div class=row>
      <div class=item>a</div>
      <div class=item>b</div>
      <div class=item>c</div>
    </div>
  <div class=row>
      <div class=item>d</div>
      <div class=item>e</div>
      <div class=item>f</div>
    </div>
  <div class=row>
      <div class=item>g</div>
      <div class=item>h</div>
      <div class=item>i</div>
    </div>
  <div class=row>
      <div class=item>j</div>
      <div class=item>k</div>
      <div class=item>l</div>
    </div>
--TEST--
"batch" filter
--TEMPLATE--
<table>
{% for row in items|batch(3, 'fill') %}
  <tr>
  {% for column in row %}
    <td>{{ column }}</td>
  {% endfor %}
  </tr>
{% endfor %}
</table>
--DATA--
return array('items' => array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'))
--EXPECT--
<table>
  <tr>
      <td>a</td>
      <td>b</td>
      <td>c</td>
    </tr>
  <tr>
      <td>d</td>
      <td>e</td>
      <td>f</td>
    </tr>
  <tr>
      <td>g</td>
      <td>h</td>
      <td>i</td>
    </tr>
  <tr>
      <td>j</td>
      <td>fill</td>
      <td>fill</td>
    </tr>
</table>
--TEST--
"convert_encoding" filter
--CONDITION--
function_exists('iconv') || function_exists('mb_convert_encoding')
--TEMPLATE--
{{ "愛していますか？"|convert_encoding('ISO-2022-JP', 'UTF-8')|convert_encoding('UTF-8', 'ISO-2022-JP') }}
--DATA--
return array()
--EXPECT--
愛していますか？
--TEST--
"date" filter (interval support as of PHP 5.3)
--CONDITION--
version_compare(phpversion(), '5.3.0', '>=')
--TEMPLATE--
{{ date2|date }}
{{ date2|date('%d days') }}
--DATA--
date_default_timezone_set('UTC');
$twig->getExtension('core')->setDateFormat('Y-m-d', '%d days %h hours');
return array(
    'date2' => new DateInterval('P2D'),
)
--EXPECT--
2 days 0 hours
2 days
--TEST--
"date" filter
--TEMPLATE--
{{ date1|date }}
{{ date1|date('d/m/Y') }}
--DATA--
date_default_timezone_set('UTC');
$twig->getExtension('core')->setDateFormat('Y-m-d', '%d days %h hours');
return array(
    'date1' => mktime(13, 45, 0, 10, 4, 2010),
)
--EXPECT--
2010-10-04
04/10/2010
--TEST--
"date" filter
--CONDITION--
version_compare(phpversion(), '5.5.0', '>=')
--TEMPLATE--
{{ date1|date }}
{{ date1|date('d/m/Y') }}
{{ date1|date('d/m/Y H:i:s', 'Asia/Hong_Kong') }}
{{ date1|date('d/m/Y H:i:s', timezone1) }}
{{ date1|date('d/m/Y H:i:s') }}

{{ date2|date('d/m/Y H:i:s P', 'Europe/Paris') }}
{{ date2|date('d/m/Y H:i:s P', 'Asia/Hong_Kong') }}
{{ date2|date('d/m/Y H:i:s P', false) }}
{{ date2|date('e', 'Europe/Paris') }}
{{ date2|date('e', false) }}
--DATA--
date_default_timezone_set('Europe/Paris');
return array(
    'date1' => new DateTimeImmutable('2010-10-04 13:45'),
    'date2' => new DateTimeImmutable('2010-10-04 13:45', new DateTimeZone('America/New_York')),
    'timezone1' => new DateTimeZone('America/New_York'),
)
--EXPECT--
October 4, 2010 13:45
04/10/2010
04/10/2010 19:45:00
04/10/2010 07:45:00
04/10/2010 13:45:00

04/10/2010 19:45:00 +02:00
05/10/2010 01:45:00 +08:00
04/10/2010 13:45:00 -04:00
Europe/Paris
America/New_York
--TEST--
"date" filter (interval support as of PHP 5.3)
--CONDITION--
version_compare(phpversion(), '5.3.0', '>=')
--TEMPLATE--
{{ date1|date }}
{{ date1|date('%d days %h hours') }}
{{ date1|date('%d days %h hours', timezone1) }}
--DATA--
date_default_timezone_set('UTC');
return array(
    'date1' => new DateInterval('P2D'),
    // This should have no effect on DateInterval formatting
    'timezone1' => new DateTimeZone('America/New_York'),
)
--EXPECT--
2 days
2 days 0 hours
2 days 0 hours
--TEST--
"date_modify" filter
--TEMPLATE--
{{ date1|date_modify('-1day')|date('Y-m-d H:i:s') }}
{{ date2|date_modify('-1day')|date('Y-m-d H:i:s') }}
--DATA--
date_default_timezone_set('UTC');
return array(
    'date1' => '2010-10-04 13:45',
    'date2' => new DateTime('2010-10-04 13:45'),
)
--EXPECT--
2010-10-03 13:45:00
2010-10-03 13:45:00
--TEST--
"date" filter
--TEMPLATE--
{{ date|date(format='d/m/Y H:i:s P', timezone='America/Chicago') }}
{{ date|date(timezone='America/Chicago', format='d/m/Y H:i:s P') }}
{{ date|date('d/m/Y H:i:s P', timezone='America/Chicago') }}
--DATA--
date_default_timezone_set('UTC');
return array('date' => mktime(13, 45, 0, 10, 4, 2010))
--EXPECT--
04/10/2010 08:45:00 -05:00
04/10/2010 08:45:00 -05:00
04/10/2010 08:45:00 -05:00
--TEST--
"date" filter
--TEMPLATE--
{{ date1|date }}
{{ date1|date('d/m/Y') }}
{{ date1|date('d/m/Y H:i:s', 'Asia/Hong_Kong') }}
{{ date1|date('d/m/Y H:i:s P', 'Asia/Hong_Kong') }}
{{ date1|date('d/m/Y H:i:s P', 'America/Chicago') }}
{{ date1|date('e') }}
{{ date1|date('d/m/Y H:i:s') }}

{{ date2|date }}
{{ date2|date('d/m/Y') }}
{{ date2|date('d/m/Y H:i:s', 'Asia/Hong_Kong') }}
{{ date2|date('d/m/Y H:i:s', timezone1) }}
{{ date2|date('d/m/Y H:i:s') }}

{{ date3|date }}
{{ date3|date('d/m/Y') }}

{{ date4|date }}
{{ date4|date('d/m/Y') }}

{{ date5|date }}
{{ date5|date('d/m/Y') }}

{{ date6|date('d/m/Y H:i:s P', 'Europe/Paris') }}
{{ date6|date('d/m/Y H:i:s P', 'Asia/Hong_Kong') }}
{{ date6|date('d/m/Y H:i:s P', false) }}
{{ date6|date('e', 'Europe/Paris') }}
{{ date6|date('e', false) }}

{{ date7|date }}
--DATA--
date_default_timezone_set('Europe/Paris');
return array(
    'date1' => mktime(13, 45, 0, 10, 4, 2010),
    'date2' => new DateTime('2010-10-04 13:45'),
    'date3' => '2010-10-04 13:45',
    'date4' => 1286199900, // DateTime::createFromFormat('Y-m-d H:i', '2010-10-04 13:45', new DateTimeZone('UTC'))->getTimestamp() -- A unixtimestamp is always GMT
    'date5' => -189291360, // DateTime::createFromFormat('Y-m-d H:i', '1964-01-02 03:04', new DateTimeZone('UTC'))->getTimestamp(),
    'date6' => new DateTime('2010-10-04 13:45', new DateTimeZone('America/New_York')),
    'date7' => '2010-01-28T15:00:00+05:00',
    'timezone1' => new DateTimeZone('America/New_York'),
)
--EXPECT--
October 4, 2010 13:45
04/10/2010
04/10/2010 19:45:00
04/10/2010 19:45:00 +08:00
04/10/2010 06:45:00 -05:00
Europe/Paris
04/10/2010 13:45:00

October 4, 2010 13:45
04/10/2010
04/10/2010 19:45:00
04/10/2010 07:45:00
04/10/2010 13:45:00

October 4, 2010 13:45
04/10/2010

October 4, 2010 15:45
04/10/2010

January 2, 1964 04:04
02/01/1964

04/10/2010 19:45:00 +02:00
05/10/2010 01:45:00 +08:00
04/10/2010 13:45:00 -04:00
Europe/Paris
America/New_York

January 28, 2010 11:00
--TEST--
"default" filter
--TEMPLATE--
Variable:
{{ definedVar                  |default('default') is same as('default') ? 'ko' : 'ok' }}
{{ zeroVar                     |default('default') is same as('default') ? 'ko' : 'ok' }}
{{ emptyVar                    |default('default') is same as('default') ? 'ok' : 'ko' }}
{{ nullVar                     |default('default') is same as('default') ? 'ok' : 'ko' }}
{{ undefinedVar                |default('default') is same as('default') ? 'ok' : 'ko' }}
Array access:
{{ nested.definedVar           |default('default') is same as('default') ? 'ko' : 'ok' }}
{{ nested['definedVar']        |default('default') is same as('default') ? 'ko' : 'ok' }}
{{ nested.zeroVar              |default('default') is same as('default') ? 'ko' : 'ok' }}
{{ nested.emptyVar             |default('default') is same as('default') ? 'ok' : 'ko' }}
{{ nested.nullVar              |default('default') is same as('default') ? 'ok' : 'ko' }}
{{ nested.undefinedVar         |default('default') is same as('default') ? 'ok' : 'ko' }}
{{ nested['undefinedVar']      |default('default') is same as('default') ? 'ok' : 'ko' }}
{{ undefinedVar.foo            |default('default') is same as('default') ? 'ok' : 'ko' }}
Plain values:
{{ 'defined'                   |default('default') is same as('default') ? 'ko' : 'ok' }}
{{ 0                           |default('default') is same as('default') ? 'ko' : 'ok' }}
{{ ''                          |default('default') is same as('default') ? 'ok' : 'ko' }}
{{ null                        |default('default') is same as('default') ? 'ok' : 'ko' }}
Precedence:
{{ 'o' ~ nullVar               |default('k') }}
{{ 'o' ~ nested.nullVar        |default('k') }}
Object methods:
{{ object.foo                  |default('default') is same as('default') ? 'ko' : 'ok' }}
{{ object.undefinedMethod      |default('default') is same as('default') ? 'ok' : 'ko' }}
{{ object.getFoo()             |default('default') is same as('default') ? 'ko' : 'ok' }}
{{ object.getFoo('a')          |default('default') is same as('default') ? 'ko' : 'ok' }}
{{ object.undefinedMethod()    |default('default') is same as('default') ? 'ok' : 'ko' }}
{{ object.undefinedMethod('a') |default('default') is same as('default') ? 'ok' : 'ko' }}
Deep nested:
{{ nested.undefinedVar.foo.bar |default('default') is same as('default') ? 'ok' : 'ko' }}
{{ nested.definedArray.0       |default('default') is same as('default') ? 'ko' : 'ok' }}
{{ nested['definedArray'][0]   |default('default') is same as('default') ? 'ko' : 'ok' }}
{{ object.self.foo             |default('default') is same as('default') ? 'ko' : 'ok' }}
{{ object.self.undefinedMethod |default('default') is same as('default') ? 'ok' : 'ko' }}
{{ object.undefinedMethod.self |default('default') is same as('default') ? 'ok' : 'ko' }}
--DATA--
return array(
    'definedVar' => 'defined',
    'zeroVar'    => 0,
    'emptyVar'   => '',
    'nullVar'    => null,
    'nested'     => array(
        'definedVar'   => 'defined',
        'zeroVar'      => 0,
        'emptyVar'     => '',
        'nullVar'      => null,
        'definedArray' => array(0),
    ),
    'object' => new TwigTestFoo(),
)
--CONFIG--
return array('strict_variables' => false)
--EXPECT--
Variable:
ok
ok
ok
ok
ok
Array access:
ok
ok
ok
ok
ok
ok
ok
ok
Plain values:
ok
ok
ok
ok
Precedence:
ok
ok
Object methods:
ok
ok
ok
ok
ok
ok
Deep nested:
ok
ok
ok
ok
ok
ok
--DATA--
return array(
    'definedVar' => 'defined',
    'zeroVar'    => 0,
    'emptyVar'   => '',
    'nullVar'    => null,
    'nested'     => array(
        'definedVar'   => 'defined',
        'zeroVar'      => 0,
        'emptyVar'     => '',
        'nullVar'      => null,
        'definedArray' => array(0),
    ),
    'object' => new TwigTestFoo(),
)
--CONFIG--
return array('strict_variables' => true)
--EXPECT--
Variable:
ok
ok
ok
ok
ok
Array access:
ok
ok
ok
ok
ok
ok
ok
ok
Plain values:
ok
ok
ok
ok
Precedence:
ok
ok
Object methods:
ok
ok
ok
ok
ok
ok
Deep nested:
ok
ok
ok
ok
ok
ok
--TEST--
dynamic filter
--TEMPLATE--
{{ 'bar'|foo_path }}
{{ 'bar'|a_foo_b_bar }}
--DATA--
return array()
--EXPECT--
foo/bar
a/b/bar
--TEST--
"escape" filter does not escape with the html strategy when using the html_attr strategy
--TEMPLATE--
{{ '<br />'|escape('html_attr') }}
--DATA--
return array()
--EXPECT--
&lt;br&#x20;&#x2F;&gt;
--TEST--
"escape" filter
--TEMPLATE--
{{ "愛していますか？ <br />"|e }}
--DATA--
return array()
--EXPECT--
愛していますか？ &lt;br /&gt;
--TEST--
"escape" filter
--TEMPLATE--
{{ "foo <br />"|e }}
--DATA--
return array()
--EXPECT--
foo &lt;br /&gt;
--TEST--
"first" filter
--TEMPLATE--
{{ [1, 2, 3, 4]|first }}
{{ {a: 1, b: 2, c: 3, d: 4}|first }}
{{ '1234'|first }}
{{ arr|first }}
{{ 'Ä€é'|first }}
{{ ''|first }}
--DATA--
return array('arr' => new ArrayObject(array(1, 2, 3, 4)))
--EXPECT--
1
1
1
1
Ä
--TEST--
"escape" filter
--TEMPLATE--
{% set foo %}
    foo<br />
{% endset %}

{{ foo|e('html') -}}
{{ foo|e('js') }}
{% autoescape true %}
    {{ foo }}
{% endautoescape %}
--DATA--
return array()
--EXPECT--
    foo&lt;br /&gt;
\x20\x20\x20\x20foo\x3Cbr\x20\x2F\x3E\x0A
        foo<br />
--TEST--
"format" filter
--TEMPLATE--
{{ string|format(foo, 3) }}
--DATA--
return array('string' => '%s/%d', 'foo' => 'bar')
--EXPECT--
bar/3
--TEST--
"join" filter
--TEMPLATE--
{{ ["foo", "bar"]|join(', ') }}
{{ foo|join(', ') }}
{{ bar|join(', ') }}
--DATA--
return array('foo' => new TwigTestFoo(), 'bar' => new ArrayObject(array(3, 4)))
--EXPECT--
foo, bar
1, 2
3, 4
--TEST--
"json_encode" filter
--TEMPLATE--
{{ "foo"|json_encode|raw }}
{{ foo|json_encode|raw }}
{{ [foo, "foo"]|json_encode|raw }}
--DATA--
return array('foo' => new Twig_Markup('foo', 'UTF-8'))
--EXPECT--
"foo"
"foo"
["foo","foo"]
--TEST--
"last" filter
--TEMPLATE--
{{ [1, 2, 3, 4]|last }}
{{ {a: 1, b: 2, c: 3, d: 4}|last }}
{{ '1234'|last }}
{{ arr|last }}
{{ 'Ä€é'|last }}
{{ ''|last }}
--DATA--
return array('arr' => new ArrayObject(array(1, 2, 3, 4)))
--EXPECT--
4
4
4
4
é
--TEST--
"length" filter
--TEMPLATE--
{{ array|length }}
{{ string|length }}
{{ number|length }}
{{ markup|length }}
--DATA--
return array('array' => array(1, 4), 'string' => 'foo', 'number' => 1000, 'markup' => new Twig_Markup('foo', 'UTF-8'))
--EXPECT--
2
3
4
3
--TEST--
"length" filter
--CONDITION--
function_exists('mb_get_info')
--TEMPLATE--
{{ string|length }}
{{ markup|length }}
--DATA--
return array('string' => 'été', 'markup' => new Twig_Markup('foo', 'UTF-8'))
--EXPECT--
3
3
--TEST--
"merge" filter
--TEMPLATE--
{{ items|merge({'bar': 'foo'})|join }}
{{ items|merge({'bar': 'foo'})|keys|join }}
{{ {'bar': 'foo'}|merge(items)|join }}
{{ {'bar': 'foo'}|merge(items)|keys|join }}
{{ numerics|merge([4, 5, 6])|join }}
--DATA--
return array('items' => array('foo' => 'bar'), 'numerics' => array(1, 2, 3))
--EXPECT--
barfoo
foobar
foobar
barfoo
123456
--TEST--
"nl2br" filter
--TEMPLATE--
{{ "I like Twig.\nYou will like it too.\n\nEverybody like it!"|nl2br }}
{{ text|nl2br }}
--DATA--
return array('text' => "If you have some <strong>HTML</strong>\nit will be escaped.")
--EXPECT--
I like Twig.<br />
You will like it too.<br />
<br />
Everybody like it!
If you have some &lt;strong&gt;HTML&lt;/strong&gt;<br />
it will be escaped.
--TEST--
"number_format" filter with defaults.
--TEMPLATE--
{{ 20|number_format }}
{{ 20.25|number_format }}
{{ 20.25|number_format(1) }}
{{ 20.25|number_format(2, ',') }}
{{ 1020.25|number_format }}
{{ 1020.25|number_format(2, ',') }}
{{ 1020.25|number_format(2, ',', '.') }}
--DATA--
$twig->getExtension('core')->setNumberFormat(2, '!', '=');
return array();
--EXPECT--
20!00
20!25
20!3
20,25
1=020!25
1=020,25
1.020,25
--TEST--
"number_format" filter
--TEMPLATE--
{{ 20|number_format }}
{{ 20.25|number_format }}
{{ 20.25|number_format(2) }}
{{ 20.25|number_format(2, ',') }}
{{ 1020.25|number_format(2, ',') }}
{{ 1020.25|number_format(2, ',', '.') }}
--DATA--
return array();
--EXPECT--
20
20
20.25
20,25
1,020,25
1.020,25
--TEST--
"replace" filter
--TEMPLATE--
{{ "I like %this% and %that%."|replace({'%this%': "foo", '%that%': "bar"}) }}
--DATA--
return array()
--EXPECT--
I like foo and bar.
--TEST--
"reverse" filter
--TEMPLATE--
{{ [1, 2, 3, 4]|reverse|join('') }}
{{ '1234évènement'|reverse }}
{{ arr|reverse|join('') }}
{{ {'a': 'c', 'b': 'a'}|reverse()|join(',') }}
{{ {'a': 'c', 'b': 'a'}|reverse(preserveKeys=true)|join(glue=',') }}
{{ {'a': 'c', 'b': 'a'}|reverse(preserve_keys=true)|join(glue=',') }}
--DATA--
return array('arr' => new ArrayObject(array(1, 2, 3, 4)))
--EXPECT--
4321
tnemenèvé4321
4321
a,c
a,c
a,c
--TEST--
"round" filter
--TEMPLATE--
{{ 2.7|round }}
{{ 2.1|round }}
{{ 2.1234|round(3, 'floor') }}
{{ 2.1|round(0, 'ceil') }}

{{ 21.3|round(-1)}}
{{ 21.3|round(-1, 'ceil')}}
{{ 21.3|round(-1, 'floor')}}
--DATA--
return array()
--EXPECT--
3
2
2.123
3

20
30
20
--TEST--
"slice" filter
--TEMPLATE--
{{ [1, 2, 3, 4][1:2]|join('') }}
{{ {a: 1, b: 2, c: 3, d: 4}[1:2]|join('') }}
{{ [1, 2, 3, 4][start:length]|join('') }}
{{ [1, 2, 3, 4]|slice(1, 2)|join('') }}
{{ [1, 2, 3, 4]|slice(1, 2)|keys|join('') }}
{{ [1, 2, 3, 4]|slice(1, 2, true)|keys|join('') }}
{{ {a: 1, b: 2, c: 3, d: 4}|slice(1, 2)|join('') }}
{{ {a: 1, b: 2, c: 3, d: 4}|slice(1, 2)|keys|join('') }}
{{ '1234'|slice(1, 2) }}
{{ '1234'[1:2] }}
{{ arr|slice(1, 2)|join('') }}
{{ arr[1:2]|join('') }}

{{ [1, 2, 3, 4]|slice(1)|join('') }}
{{ [1, 2, 3, 4][1:]|join('') }}
{{ '1234'|slice(1) }}
{{ '1234'[1:] }}
{{ '1234'[:1] }}
--DATA--
return array('start' => 1, 'length' => 2, 'arr' => new ArrayObject(array(1, 2, 3, 4)))
--EXPECT--
23
23
23
23
01
12
23
bc
23
23
23
23

234
234
234
234
1
--TEST--
"sort" filter
--TEMPLATE--
{{ array1|sort|join }}
{{ array2|sort|join }}
--DATA--
return array('array1' => array(4, 1), 'array2' => array('foo', 'bar'))
--EXPECT--
14
barfoo
--TEST--
"split" filter
--TEMPLATE--
{{ "one,two,three,four,five"|split(',')|join('-') }}
{{ foo|split(',')|join('-') }}
{{ foo|split(',', 3)|join('-') }}
{{ baz|split('')|join('-') }}
{{ baz|split('', 2)|join('-') }}
{{ foo|split(',', -2)|join('-') }}
--DATA--
return array('foo' => "one,two,three,four,five", 'baz' => '12345',)
--EXPECT--
one-two-three-four-five
one-two-three-four-five
one-two-three,four,five
1-2-3-4-5
12-34-5
one-two-three--TEST--
"trim" filter
--TEMPLATE--
{{ "  I like Twig.  "|trim }}
{{ text|trim }}
{{ "  foo/"|trim("/") }}
--DATA--
return array('text' => "  If you have some <strong>HTML</strong> it will be escaped.  ")
--EXPECT--
I like Twig.
If you have some &lt;strong&gt;HTML&lt;/strong&gt; it will be escaped.
  foo
--TEST--
"url_encode" filter for PHP < 5.4 and HHVM
--CONDITION--
defined('PHP_QUERY_RFC3986')
--TEMPLATE--
{{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode }}
{{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode|raw }}
{{ {}|url_encode|default("default") }}
{{ 'spéßi%le%c0d@dspa ce'|url_encode }}
--DATA--
return array()
--EXPECT--
foo=bar&amp;number=3&amp;sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&amp;spa%20ce=
foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa%20ce=
default
sp%C3%A9%C3%9Fi%25le%25c0d%40dspa%20ce
--TEST--
"url_encode" filter
--CONDITION--
defined('PHP_QUERY_RFC3986')
--TEMPLATE--
{{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode }}
{{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode|raw }}
{{ {}|url_encode|default("default") }}
{{ 'spéßi%le%c0d@dspa ce'|url_encode }}
--DATA--
return array()
--EXPECT--
foo=bar&amp;number=3&amp;sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&amp;spa%20ce=
foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa%20ce=
default
sp%C3%A9%C3%9Fi%25le%25c0d%40dspa%20ce
--TEST--
"attribute" function
--TEMPLATE--
{{ attribute(obj, method) }}
{{ attribute(array, item) }}
{{ attribute(obj, "bar", ["a", "b"]) }}
{{ attribute(obj, "bar", arguments) }}
{{ attribute(obj, method) is defined ? 'ok' : 'ko' }}
{{ attribute(obj, nonmethod) is defined ? 'ok' : 'ko' }}
--DATA--
return array('obj' => new TwigTestFoo(), 'method' => 'foo', 'array' => array('foo' => 'bar'), 'item' => 'foo', 'nonmethod' => 'xxx', 'arguments' => array('a', 'b'))
--EXPECT--
foo
bar
bar_a-b
bar_a-b
ok
ko
--TEST--
"block" function
--TEMPLATE--
{% extends 'base.twig' %}
{% block bar %}BAR{% endblock %}
--TEMPLATE(base.twig)--
{% block foo %}{{ block('bar') }}{% endblock %}
{% block bar %}BAR_BASE{% endblock %}
--DATA--
return array()
--EXPECT--
BARBAR
--TEST--
"constant" function
--TEMPLATE--
{{ constant('DATE_W3C') == expect ? 'true' : 'false' }}
{{ constant('ARRAY_AS_PROPS', object) }}
--DATA--
return array('expect' => DATE_W3C, 'object' => new ArrayObject(array('hi')));
--EXPECT--
true
2
--TEST--
"cycle" function
--TEMPLATE--
{% for i in 0..6 %}
{{ cycle(array1, i) }}-{{ cycle(array2, i) }}
{% endfor %}
--DATA--
return array('array1' => array('odd', 'even'), 'array2' => array('apple', 'orange', 'citrus'))
--EXPECT--
odd-apple
even-orange
odd-citrus
even-apple
odd-orange
even-citrus
odd-apple
--TEST--
"date" function
--TEMPLATE--
{{ date(date, "America/New_York")|date('d/m/Y H:i:s P', false) }}
{{ date(timezone="America/New_York", date=date)|date('d/m/Y H:i:s P', false) }}
--DATA--
date_default_timezone_set('UTC');
return array('date' => mktime(13, 45, 0, 10, 4, 2010))
--EXPECT--
04/10/2010 09:45:00 -04:00
04/10/2010 09:45:00 -04:00
--TEST--
"date" function
--TEMPLATE--
{{ date() == date('now') ? 'OK' : 'KO' }}
{{ date(date1) == date('2010-10-04 13:45') ? 'OK' : 'KO' }}
{{ date(date2) == date('2010-10-04 13:45') ? 'OK' : 'KO' }}
{{ date(date3) == date('2010-10-04 13:45') ? 'OK' : 'KO' }}
{{ date(date4) == date('2010-10-04 13:45') ? 'OK' : 'KO' }}
{{ date(date5) == date('1964-01-02 03:04') ? 'OK' : 'KO' }}
--DATA--
date_default_timezone_set('UTC');
return array(
    'date1' => mktime(13, 45, 0, 10, 4, 2010),
    'date2' => new DateTime('2010-10-04 13:45'),
    'date3' => '2010-10-04 13:45',
    'date4' => 1286199900, // DateTime::createFromFormat('Y-m-d H:i', '2010-10-04 13:45', new DateTimeZone('UTC'))->getTimestamp() -- A unixtimestamp is always GMT
    'date5' => -189291360, // DateTime::createFromFormat('Y-m-d H:i', '1964-01-02 03:04', new DateTimeZone('UTC'))->getTimestamp(),
)
--EXPECT--
OK
OK
OK
OK
OK
OK
--TEST--
"dump" function, xdebug is not loaded or xdebug <2.2-dev is loaded
--CONDITION--
!extension_loaded('xdebug') || (($r = new ReflectionExtension('xdebug')) && version_compare($r->getVersion(), '2.2-dev', '<'))
--TEMPLATE--
{{ dump() }}
--DATA--
return array('foo' => 'foo', 'bar' => 'bar')
--CONFIG--
return array('debug' => true, 'autoescape' => false);
--TEST--
"dump" function
--CONDITION--
!extension_loaded('xdebug')
--TEMPLATE--
{{ dump('foo') }}
{{ dump('foo', 'bar') }}
--DATA--
return array('foo' => 'foo', 'bar' => 'bar')
--CONFIG--
return array('debug' => true, 'autoescape' => false);
--EXPECT--
string(3) "foo"

string(3) "foo"
string(3) "bar"
--TEST--
dynamic function
--TEMPLATE--
{{ foo_path('bar') }}
{{ a_foo_b_bar('bar') }}
--DATA--
return array()
--EXPECT--
foo/bar
a/b/bar
--TEST--
"include" function
--TEMPLATE--
{% set tmp = include("foo.twig") %}

FOO{{ tmp }}BAR
--TEMPLATE(foo.twig)--
FOOBAR
--DATA--
return array()
--EXPECT--
FOO
FOOBARBAR
--TEST--
"include" function is safe for auto-escaping
--TEMPLATE--
{{ include("foo.twig") }}
--TEMPLATE(foo.twig)--
<p>Test</p>
--DATA--
return array()
--EXPECT--
<p>Test</p>
--TEST--
"include" function
--TEMPLATE--
FOO
{{ include("foo.twig") }}

BAR
--TEMPLATE(foo.twig)--
FOOBAR
--DATA--
return array()
--EXPECT--
FOO

FOOBAR

BAR
--TEST--
"include" function allows expressions for the template to include
--TEMPLATE--
FOO
{{ include(foo) }}

BAR
--TEMPLATE(foo.twig)--
FOOBAR
--DATA--
return array('foo' => 'foo.twig')
--EXPECT--
FOO

FOOBAR

BAR
--TEST--
"include" function
--TEMPLATE--
{{ include(["foo.twig", "bar.twig"], ignore_missing = true) }}
{{ include("foo.twig", ignore_missing = true) }}
{{ include("foo.twig", ignore_missing = true, variables = {}) }}
{{ include("foo.twig", ignore_missing = true, variables = {}, with_context = true) }}
--DATA--
return array()
--EXPECT--
--TEST--
"include" function
--TEMPLATE--
{% extends "base.twig" %}

{% block content %}
    {{ parent() }}
{% endblock %}
--TEMPLATE(base.twig)--
{% block content %}
    {{ include("foo.twig") }}
{% endblock %}
--DATA--
return array();
--EXCEPTION--
Twig_Error_Loader: Template "foo.twig" is not defined in "base.twig" at line 3.
--TEST--
"include" function
--TEMPLATE--
{{ include("foo.twig") }}
--DATA--
return array();
--EXCEPTION--
Twig_Error_Loader: Template "foo.twig" is not defined in "index.twig" at line 2.
--TEST--
"include" tag sandboxed
--TEMPLATE--
{{ include("foo.twig", sandboxed = true) }}
--TEMPLATE(foo.twig)--
{{ foo|e }}
--DATA--
return array()
--EXCEPTION--
Twig_Sandbox_SecurityError: Filter "e" is not allowed in "index.twig" at line 2.
--TEST--
"include" function accepts Twig_Template instance
--TEMPLATE--
{{ include(foo) }} FOO
--TEMPLATE(foo.twig)--
BAR
--DATA--
return array('foo' => $twig->loadTemplate('foo.twig'))
--EXPECT--
BAR FOO
--TEST--
"include" function
--TEMPLATE--
{{ include(["foo.twig", "bar.twig"]) }}
{{- include(["bar.twig", "foo.twig"]) }}
--TEMPLATE(foo.twig)--
foo
--DATA--
return array()
--EXPECT--
foo
foo
--TEST--
"include" function accept variables and with_context
--TEMPLATE--
{{ include("foo.twig") }}
{{- include("foo.twig", with_context = false) }}
{{- include("foo.twig", {'foo1': 'bar'}) }}
{{- include("foo.twig", {'foo1': 'bar'}, with_context = false) }}
--TEMPLATE(foo.twig)--
{% for k, v in _context %}{{ k }},{% endfor %}
--DATA--
return array('foo' => 'bar')
--EXPECT--
foo,global,_parent,
global,_parent,
foo,global,foo1,_parent,
foo1,global,_parent,
--TEST--
"include" function accept variables
--TEMPLATE--
{{ include("foo.twig", {'foo': 'bar'}) }}
{{- include("foo.twig", vars) }}
--TEMPLATE(foo.twig)--
{{ foo }}
--DATA--
return array('vars' => array('foo' => 'bar'))
--EXPECT--
bar
bar
--TEST--
"max" function
--TEMPLATE--
{{ max([2, 1, 3, 5, 4]) }}
{{ max(2, 1, 3, 5, 4) }}
{{ max({2:"two", 1:"one", 3:"three", 5:"five", 4:"for"}) }}
--DATA--
return array()
--EXPECT--
5
5
two
--TEST--
"min" function
--TEMPLATE--
{{ min(2, 1, 3, 5, 4) }}
{{ min([2, 1, 3, 5, 4]) }}
{{ min({2:"two", 1:"one", 3:"three", 5:"five", 4:"for"}) }}
--DATA--
return array()
--EXPECT--
1
1
five
--TEST--
"range" function
--TEMPLATE--
{{ range(low=0+1, high=10+0, step=2)|join(',') }}
--DATA--
return array()
--EXPECT--
1,3,5,7,9
--TEST--
"block" function recursively called in a parent template
--TEMPLATE--
{% extends "ordered_menu.twig" %}
{% block label %}"{{ parent() }}"{% endblock %}
{% block list %}{% set class = 'b' %}{{ parent() }}{% endblock %}
--TEMPLATE(ordered_menu.twig)--
{% extends "menu.twig" %}
{% block list %}{% set class = class|default('a') %}<ol class="{{ class }}">{{ block('children') }}</ol>{% endblock %}
--TEMPLATE(menu.twig)--
{% extends "base.twig" %}
{% block list %}<ul>{{ block('children') }}</ul>{% endblock %}
{% block children %}{% set currentItem = item %}{% for item in currentItem %}{{ block('item') }}{% endfor %}{% set item = currentItem %}{% endblock %}
{% block item %}<li>{% if item is not iterable %}{{ block('label') }}{% else %}{{ block('list') }}{% endif %}</li>{% endblock %}
{% block label %}{{ item }}{{ block('unknown') }}{% endblock %}
--TEMPLATE(base.twig)--
{{ block('list') }}
--DATA--
return array('item' => array('1', '2', array('3.1', array('3.2.1', '3.2.2'), '3.4')))
--EXPECT--
<ol class="b"><li>"1"</li><li>"2"</li><li><ol class="b"><li>"3.1"</li><li><ol class="b"><li>"3.2.1"</li><li>"3.2.2"</li></ol></li><li>"3.4"</li></ol></li></ol>
--TEST--
"source" function
--TEMPLATE--
FOO
{{ source("foo.twig") }}

BAR
--TEMPLATE(foo.twig)--
{{ foo }}<br />
--DATA--
return array()
--EXPECT--
FOO

{{ foo }}<br />

BAR
--TEST--
"template_from_string" function
--TEMPLATE--
{% include template_from_string(template) %}

{% include template_from_string("Hello {{ name }}") %}
{% include template_from_string('{% extends "parent.twig" %}{% block content %}Hello {{ name }}{% endblock %}') %}
--TEMPLATE(parent.twig)--
{% block content %}{% endblock %}
--DATA--
return array('name' => 'Fabien', 'template' => "Hello {{ name }}")
--EXPECT--
Hello Fabien
Hello Fabien
Hello Fabien
--TEST--
macro
--TEMPLATE--
{% from _self import test %}

{% macro test(a, b = 'bar') -%}
{{ a }}{{ b }}
{%- endmacro %}

{{ test('foo') }}
{{ test('bar', 'foo') }}
--DATA--
return array();
--EXPECT--
foobar
barfoo
--TEST--
macro
--TEMPLATE--
{% import _self as macros %}

{% macro foo(data) %}
    {{ data }}
{% endmacro %}

{% macro bar() %}
    <br />
{% endmacro %}

{{ macros.foo(macros.bar()) }}
--DATA--
return array();
--EXPECT--
<br />
--TEST--
macro
--TEMPLATE--
{% from _self import test %}

{% macro test(this) -%}
    {{ this }}
{%- endmacro %}

{{ test(this) }}
--DATA--
return array('this' => 'foo');
--EXPECT--
foo
--TEST--
macro
--TEMPLATE--
{% import _self as test %}
{% from _self import test %}

{% macro test(a, b) -%}
    {{ a|default('a') }}<br />
    {{- b|default('b') }}<br />
{%- endmacro %}

{{ test.test() }}
{{ test() }}
{{ test.test(1, "c") }}
{{ test(1, "c") }}
--DATA--
return array();
--EXPECT--
a<br />b<br />
a<br />b<br />
1<br />c<br />
1<br />c<br />
--TEST--
macro with a filter
--TEMPLATE--
{% import _self as test %}

{% macro test() %}
    {% filter escape %}foo<br />{% endfilter %}
{% endmacro %}

{{ test.test() }}
--DATA--
return array();
--EXPECT--
foo&lt;br /&gt;
--TEST--
Twig outputs 0 nodes correctly
--TEMPLATE--
{{ foo }}0{{ foo }}
--DATA--
return array('foo' => 'foo')
--EXPECT--
foo0foo
--TEST--
error in twig extension
--TEMPLATE--
{{ object.region is not null ? object.regionChoices[object.region] }}
--EXPECT--
house.region.s
--TEST--
Twig is able to deal with SimpleXMLElement instances as variables
--CONDITION--
version_compare(phpversion(), '5.3.0', '>=')
--TEMPLATE--
Hello '{{ images.image.0.group }}'!
{{ images.image.0.group.attributes.myattr }}
{{ images.children().image.count() }}
{% for image in images %}
    - {{ image.group }}
{% endfor %}
--DATA--
return array('images' => new SimpleXMLElement('<images><image><group myattr="example">foo</group></image><image><group>bar</group></image></images>'))
--EXPECT--
Hello 'foo'!
example
2
    - foo
    - bar
--TEST--
Twig does not confuse strings with integers in getAttribute()
--TEMPLATE--
{{ hash['2e2'] }}
--DATA--
return array('hash' => array('2e2' => 'works'))
--EXPECT--
works
--TEST--
"autoescape" tag applies escaping on its children
--TEMPLATE--
{% autoescape %}
{{ var }}<br />
{% endautoescape %}
{% autoescape 'html' %}
{{ var }}<br />
{% endautoescape %}
{% autoescape false %}
{{ var }}<br />
{% endautoescape %}
{% autoescape true %}
{{ var }}<br />
{% endautoescape %}
{% autoescape false %}
{{ var }}<br />
{% endautoescape %}
--DATA--
return array('var' => '<br />')
--EXPECT--
&lt;br /&gt;<br />
&lt;br /&gt;<br />
<br /><br />
&lt;br /&gt;<br />
<br /><br />
--TEST--
"autoescape" tag applies escaping on embedded blocks
--TEMPLATE--
{% autoescape 'html' %}
  {% block foo %}
    {{ var }}
  {% endblock %}
{% endautoescape %}
--DATA--
return array('var' => '<br />')
--EXPECT--
&lt;br /&gt;
--TEST--
"autoescape" tag does not double-escape
--TEMPLATE--
{% autoescape 'html' %}
{{ var|escape }}
{% endautoescape %}
--DATA--
return array('var' => '<br />')
--EXPECT--
&lt;br /&gt;
--TEST--
"autoescape" tag applies escaping after calling functions
--TEMPLATE--

autoescape false
{% autoescape false %}

safe_br
{{ safe_br() }}

unsafe_br
{{ unsafe_br() }}

{% endautoescape %}

autoescape 'html'
{% autoescape 'html' %}

safe_br
{{ safe_br() }}

unsafe_br
{{ unsafe_br() }}

unsafe_br()|raw
{{ (unsafe_br())|raw }}

safe_br()|escape
{{ (safe_br())|escape }}

safe_br()|raw
{{ (safe_br())|raw }}

unsafe_br()|escape
{{ (unsafe_br())|escape }}

{% endautoescape %}

autoescape js
{% autoescape 'js' %}

safe_br
{{ safe_br() }}

{% endautoescape %}
--DATA--
return array()
--EXPECT--

autoescape false

safe_br
<br />

unsafe_br
<br />


autoescape 'html'

safe_br
<br />

unsafe_br
&lt;br /&gt;

unsafe_br()|raw
<br />

safe_br()|escape
&lt;br /&gt;

safe_br()|raw
<br />

unsafe_br()|escape
&lt;br /&gt;


autoescape js

safe_br
\x3Cbr\x20\x2F\x3E
--TEST--
"autoescape" tag does not apply escaping on literals
--TEMPLATE--
{% autoescape 'html' %}

1. Simple literal
{{ "<br />" }}

2. Conditional expression with only literals
{{ true ? "<br />" : "<br>" }}

3. Conditional expression with a variable
{{ true ? "<br />" : someVar }}

4. Nested conditionals with only literals
{{ true ? (true ? "<br />" : "<br>") : "\n" }}

5. Nested conditionals with a variable
{{ true ? (true ? "<br />" : someVar) : "\n" }}

6. Nested conditionals with a variable marked safe
{{ true ? (true ? "<br />" : someVar|raw) : "\n" }}

{% endautoescape %}
--DATA--
return array()
--EXPECT--

1. Simple literal
<br />

2. Conditional expression with only literals
<br />

3. Conditional expression with a variable
&lt;br /&gt;

4. Nested conditionals with only literals
<br />

5. Nested conditionals with a variable
&lt;br /&gt;

6. Nested conditionals with a variable marked safe
<br />
--TEST--
"autoescape" tags can be nested at will
--TEMPLATE--
{{ var }}
{% autoescape 'html' %}
  {{ var }}
  {% autoescape false %}
    {{ var }}
    {% autoescape 'html' %}
      {{ var }}
    {% endautoescape %}
    {{ var }}
  {% endautoescape %}
  {{ var }}
{% endautoescape %}
{{ var }}
--DATA--
return array('var' => '<br />')
--EXPECT--
&lt;br /&gt;
  &lt;br /&gt;
      <br />
          &lt;br /&gt;
        <br />
    &lt;br /&gt;
&lt;br /&gt;
--TEST--
"autoescape" tag applies escaping to object method calls
--TEMPLATE--
{% autoescape 'html' %}
{{ user.name }}
{{ user.name|lower }}
{{ user }}
{% endautoescape %}
--EXPECT--
Fabien&lt;br /&gt;
fabien&lt;br /&gt;
Fabien&lt;br /&gt;
--TEST--
"autoescape" tag does not escape when raw is used as a filter
--TEMPLATE--
{% autoescape 'html' %}
{{ var|raw }}
{% endautoescape %}
--DATA--
return array('var' => '<br />')
--EXPECT--
<br />
--TEST--
"autoescape" tag accepts an escaping strategy
--TEMPLATE--
{% autoescape true js %}{{ var }}{% endautoescape %}

{% autoescape true html %}{{ var }}{% endautoescape %}

{% autoescape 'js' %}{{ var }}{% endautoescape %}

{% autoescape 'html' %}{{ var }}{% endautoescape %}
--DATA--
return array('var' => '<br />"')
--EXPECT--
\x3Cbr\x20\x2F\x3E\x22
&lt;br /&gt;&quot;
\x3Cbr\x20\x2F\x3E\x22
&lt;br /&gt;&quot;
--TEST--
escape types
--TEMPLATE--

1. autoescape 'html' |escape('js')

{% autoescape 'html' %}
<a onclick="alert(&quot;{{ msg|escape('js') }}&quot;)"></a>
{% endautoescape %}

2. autoescape 'html' |escape('js')

{% autoescape 'html' %}
<a onclick="alert(&quot;{{ msg|escape('js') }}&quot;)"></a>
{% endautoescape %}

3. autoescape 'js' |escape('js')

{% autoescape 'js' %}
<a onclick="alert(&quot;{{ msg|escape('js') }}&quot;)"></a>
{% endautoescape %}

4. no escape

{% autoescape false %}
<a onclick="alert(&quot;{{ msg }}&quot;)"></a>
{% endautoescape %}

5. |escape('js')|escape('html')

{% autoescape false %}
<a onclick="alert(&quot;{{ msg|escape('js')|escape('html') }}&quot;)"></a>
{% endautoescape %}

6. autoescape 'html' |escape('js')|escape('html')

{% autoescape 'html' %}
<a onclick="alert(&quot;{{ msg|escape('js')|escape('html') }}&quot;)"></a>
{% endautoescape %}

--DATA--
return array('msg' => "<>\n'\"")
--EXPECT--

1. autoescape 'html' |escape('js')

<a onclick="alert(&quot;\x3C\x3E\x0A\x27\x22&quot;)"></a>

2. autoescape 'html' |escape('js')

<a onclick="alert(&quot;\x3C\x3E\x0A\x27\x22&quot;)"></a>

3. autoescape 'js' |escape('js')

<a onclick="alert(&quot;\x3C\x3E\x0A\x27\x22&quot;)"></a>

4. no escape

<a onclick="alert(&quot;<>
'"&quot;)"></a>

5. |escape('js')|escape('html')

<a onclick="alert(&quot;\x3C\x3E\x0A\x27\x22&quot;)"></a>

6. autoescape 'html' |escape('js')|escape('html')

<a onclick="alert(&quot;\x3C\x3E\x0A\x27\x22&quot;)"></a>

--TEST--
"autoescape" tag do not applies escaping on filter arguments
--TEMPLATE--
{% autoescape 'html' %}
{{ var|nl2br("<br />") }}
{{ var|nl2br("<br />"|escape) }}
{{ var|nl2br(sep) }}
{{ var|nl2br(sep|raw) }}
{{ var|nl2br(sep|escape) }}
{% endautoescape %}
--DATA--
return array('var' => "<Fabien>\nTwig", 'sep' => '<br />')
--EXPECT--
&lt;Fabien&gt;<br />
Twig
&lt;Fabien&gt;&lt;br /&gt;
Twig
&lt;Fabien&gt;<br />
Twig
&lt;Fabien&gt;<br />
Twig
&lt;Fabien&gt;&lt;br /&gt;
Twig
--TEST--
"autoescape" tag applies escaping after calling filters
--TEMPLATE--
{% autoescape 'html' %}

(escape_and_nl2br is an escaper filter)

1. Don't escape escaper filter output
( var is escaped by |escape_and_nl2br, line-breaks are added, 
  the output is not escaped )
{{ var|escape_and_nl2br }}

2. Don't escape escaper filter output
( var is escaped by |escape_and_nl2br, line-breaks are added, 
  the output is not escaped, |raw is redundant )
{{ var|escape_and_nl2br|raw }}

3. Explicit escape
( var is escaped by |escape_and_nl2br, line-breaks are added,
  the output is explicitly escaped by |escape )
{{ var|escape_and_nl2br|escape }}

4. Escape non-escaper filter output
( var is upper-cased by |upper,
  the output is auto-escaped )
{{ var|upper }}

5. Escape if last filter is not an escaper
( var is escaped by |escape_and_nl2br, line-breaks are added,
  the output is upper-cased by |upper,
  the output is auto-escaped as |upper is not an escaper )
{{ var|escape_and_nl2br|upper }}

6. Don't escape escaper filter output
( var is upper cased by upper,
  the output is escaped by |escape_and_nl2br, line-breaks are added,
  the output is not escaped as |escape_and_nl2br is an escaper )
{{ var|upper|escape_and_nl2br }}

7. Escape if last filter is not an escaper
( the output of |format is "<b>" ~ var ~ "</b>",
  the output is auto-escaped )
{{ "<b>%s</b>"|format(var) }}

8. Escape if last filter is not an escaper
( the output of |format is "<b>" ~ var ~ "</b>",
  |raw is redundant,
  the output is auto-escaped )
{{ "<b>%s</b>"|raw|format(var) }}

9. Don't escape escaper filter output
( the output of |format is "<b>" ~ var ~ "</b>",
  the output is not escaped due to |raw filter at the end )
{{ "<b>%s</b>"|format(var)|raw }}

10. Don't escape escaper filter output
( the output of |format is "<b>" ~ var ~ "</b>",
  the output is not escaped due to |raw filter at the end,
  the |raw filter on var is redundant )
{{ "<b>%s</b>"|format(var|raw)|raw }}

{% endautoescape %}
--DATA--
return array('var' => "<Fabien>\nTwig")
--EXPECT--

(escape_and_nl2br is an escaper filter)

1. Don't escape escaper filter output
( var is escaped by |escape_and_nl2br, line-breaks are added, 
  the output is not escaped )
&lt;Fabien&gt;<br />
Twig

2. Don't escape escaper filter output
( var is escaped by |escape_and_nl2br, line-breaks are added, 
  the output is not escaped, |raw is redundant )
&lt;Fabien&gt;<br />
Twig

3. Explicit escape
( var is escaped by |escape_and_nl2br, line-breaks are added,
  the output is explicitly escaped by |escape )
&amp;lt;Fabien&amp;gt;&lt;br /&gt;
Twig

4. Escape non-escaper filter output
( var is upper-cased by |upper,
  the output is auto-escaped )
&lt;FABIEN&gt;
TWIG

5. Escape if last filter is not an escaper
( var is escaped by |escape_and_nl2br, line-breaks are added,
  the output is upper-cased by |upper,
  the output is auto-escaped as |upper is not an escaper )
&amp;LT;FABIEN&amp;GT;&lt;BR /&gt;
TWIG

6. Don't escape escaper filter output
( var is upper cased by upper,
  the output is escaped by |escape_and_nl2br, line-breaks are added,
  the output is not escaped as |escape_and_nl2br is an escaper )
&lt;FABIEN&gt;<br />
TWIG

7. Escape if last filter is not an escaper
( the output of |format is "<b>" ~ var ~ "</b>",
  the output is auto-escaped )
&lt;b&gt;&lt;Fabien&gt;
Twig&lt;/b&gt;

8. Escape if last filter is not an escaper
( the output of |format is "<b>" ~ var ~ "</b>",
  |raw is redundant,
  the output is auto-escaped )
&lt;b&gt;&lt;Fabien&gt;
Twig&lt;/b&gt;

9. Don't escape escaper filter output
( the output of |format is "<b>" ~ var ~ "</b>",
  the output is not escaped due to |raw filter at the end )
<b><Fabien>
Twig</b>

10. Don't escape escaper filter output
( the output of |format is "<b>" ~ var ~ "</b>",
  the output is not escaped due to |raw filter at the end,
  the |raw filter on var is redundant )
<b><Fabien>
Twig</b>
--TEST--
"autoescape" tag applies escaping after calling filters, and before calling pre_escape filters
--TEMPLATE--
{% autoescape 'html' %}

(nl2br is pre_escaped for "html" and declared safe for "html")

1. Pre-escape and don't post-escape
( var|escape|nl2br )
{{ var|nl2br }}

2. Don't double-pre-escape
( var|escape|nl2br )
{{ var|escape|nl2br }}

3. Don't escape safe values
( var|raw|nl2br )
{{ var|raw|nl2br }}

4. Don't escape safe values
( var|escape|nl2br|nl2br )
{{ var|nl2br|nl2br }}

5. Re-escape values that are escaped for an other contexts
( var|escape_something|escape|nl2br )
{{ var|escape_something|nl2br }}

6. Still escape when using filters not declared safe
( var|escape|nl2br|upper|escape )
{{ var|nl2br|upper }}

{% endautoescape %}
--DATA--
return array('var' => "<Fabien>\nTwig")
--EXPECT--

(nl2br is pre_escaped for "html" and declared safe for "html")

1. Pre-escape and don't post-escape
( var|escape|nl2br )
&lt;Fabien&gt;<br />
Twig

2. Don't double-pre-escape
( var|escape|nl2br )
&lt;Fabien&gt;<br />
Twig

3. Don't escape safe values
( var|raw|nl2br )
<Fabien><br />
Twig

4. Don't escape safe values
( var|escape|nl2br|nl2br )
&lt;Fabien&gt;<br /><br />
Twig

5. Re-escape values that are escaped for an other contexts
( var|escape_something|escape|nl2br )
&lt;FABIEN&gt;<br />
TWIG

6. Still escape when using filters not declared safe
( var|escape|nl2br|upper|escape )
&amp;LT;FABIEN&amp;GT;&lt;BR /&gt;
TWIG

--TEST--
"autoescape" tag handles filters preserving the safety
--TEMPLATE--
{% autoescape 'html' %}

(preserves_safety is preserving safety for "html")

1. Unsafe values are still unsafe
( var|preserves_safety|escape )
{{ var|preserves_safety }}

2. Safe values are still safe
( var|escape|preserves_safety )
{{ var|escape|preserves_safety }}

3. Re-escape values that are escaped for an other contexts
( var|escape_something|preserves_safety|escape )
{{ var|escape_something|preserves_safety }}

4. Still escape when using filters not declared safe
( var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'})|escape )
{{ var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'}) }}

{% endautoescape %}
--DATA--
return array('var' => "<Fabien>\nTwig")
--EXPECT--

(preserves_safety is preserving safety for "html")

1. Unsafe values are still unsafe
( var|preserves_safety|escape )
&lt;FABIEN&gt;
TWIG

2. Safe values are still safe
( var|escape|preserves_safety )
&LT;FABIEN&GT;
TWIG

3. Re-escape values that are escaped for an other contexts
( var|escape_something|preserves_safety|escape )
&lt;FABIEN&gt;
TWIG

4. Still escape when using filters not declared safe
( var|escape|preserves_safety|replace({'FABIEN': 'FABPOT'})|escape )
&amp;LT;FABPOT&amp;GT;
TWIG

--TEST--
"block" tag
--TEMPLATE--
{% block title1 %}FOO{% endblock %}
{% block title2 foo|lower %}
--TEMPLATE(foo.twig)--
{% block content %}{% endblock %}
--DATA--
return array('foo' => 'bar')
--EXPECT--
FOObar
--TEST--
"block" tag
--TEMPLATE--
{% block content %}
    {% block content %}
    {% endblock %}
{% endblock %}
--DATA--
return array()
--EXCEPTION--
Twig_Error_Syntax: The block 'content' has already been defined line 2 in "index.twig" at line 3
--TEST--
"§" special chars in a block name
--TEMPLATE--
{% block § %}
§
{% endblock § %}
--DATA--
return array()
--EXPECT--
§
--TEST--
"embed" tag
--TEMPLATE--
FOO
{% embed "foo.twig" %}
    {% block c1 %}
        {{ parent() }}
        block1extended
    {% endblock %}
{% endembed %}

BAR
--TEMPLATE(foo.twig)--
A
{% block c1 %}
    block1
{% endblock %}
B
{% block c2 %}
    block2
{% endblock %}
C
--DATA--
return array()
--EXPECT--
FOO

A
            block1

        block1extended
    B
    block2
C
BAR
--TEST--
"embed" tag
--TEMPLATE(index.twig)--
FOO
{% embed "foo.twig" %}
    {% block c1 %}
        {{ nothing }}
    {% endblock %}
{% endembed %}
BAR
--TEMPLATE(foo.twig)--
{% block c1 %}{% endblock %}
--DATA--
return array()
--EXCEPTION--
Twig_Error_Runtime: Variable "nothing" does not exist in "index.twig" at line 5
--TEST--
"embed" tag
--TEMPLATE--
FOO
{% embed "foo.twig" %}
    {% block c1 %}
        {{ parent() }}
        block1extended
    {% endblock %}
{% endembed %}

{% embed "foo.twig" %}
    {% block c1 %}
        {{ parent() }}
        block1extended
    {% endblock %}
{% endembed %}

BAR
--TEMPLATE(foo.twig)--
A
{% block c1 %}
    block1
{% endblock %}
B
{% block c2 %}
    block2
{% endblock %}
C
--DATA--
return array()
--EXPECT--
FOO

A
            block1

        block1extended
    B
    block2
C

A
            block1

        block1extended
    B
    block2
C
BAR
--TEST--
"embed" tag
--TEMPLATE--
{% embed "foo.twig" %}
    {% block c1 %}
        {{ parent() }}
        {% embed "foo.twig" %}
            {% block c1 %}
                {{ parent() }}
                block1extended
            {% endblock %}
        {% endembed %}

    {% endblock %}
{% endembed %}
--TEMPLATE(foo.twig)--
A
{% block c1 %}
    block1
{% endblock %}
B
{% block c2 %}
    block2
{% endblock %}
C
--DATA--
return array()
--EXPECT--
A
            block1

        
A
                    block1

                block1extended
            B
    block2
C
    B
    block2
C
--TEST--
"embed" tag
--TEMPLATE--
{% extends "base.twig" %}

{% block c1 %}
    {{ parent() }}
    blockc1baseextended
{% endblock %}

{% block c2 %}
    {{ parent() }}

    {% embed "foo.twig" %}
        {% block c1 %}
            {{ parent() }}
            block1extended
        {% endblock %}
    {% endembed %}
{% endblock %}
--TEMPLATE(base.twig)--
A
{% block c1 %}
    blockc1base
{% endblock %}
{% block c2 %}
    blockc2base
{% endblock %}
B
--TEMPLATE(foo.twig)--
A
{% block c1 %}
    block1
{% endblock %}
B
{% block c2 %}
    block2
{% endblock %}
C
--DATA--
return array()
--EXPECT--
A
        blockc1base

    blockc1baseextended
        blockc2base


    
A
                block1

            block1extended
        B
    block2
CB--TEST--
"filter" tag applies a filter on its children
--TEMPLATE--
{% filter upper %}
Some text with a {{ var }}
{% endfilter %}
--DATA--
return array('var' => 'var')
--EXPECT--
SOME TEXT WITH A VAR
--TEST--
"filter" tag applies a filter on its children
--TEMPLATE--
{% filter json_encode|raw %}test{% endfilter %}
--DATA--
return array()
--EXPECT--
"test"
--TEST--
"filter" tags accept multiple chained filters
--TEMPLATE--
{% filter lower|title %}
  {{ var }}
{% endfilter %}
--DATA--
return array('var' => 'VAR')
--EXPECT--
    Var
--TEST--
"filter" tags can be nested at will
--TEMPLATE--
{% filter lower|title %}
  {{ var }}
  {% filter upper %}
    {{ var }}
  {% endfilter %}
  {{ var }}
{% endfilter %}
--DATA--
return array('var' => 'var')
--EXPECT--
  Var
      Var
    Var
--TEST--
"filter" tag applies the filter on "for" tags
--TEMPLATE--
{% filter upper %}
{% for item in items %}
{{ item }}
{% endfor %}
{% endfilter %}
--DATA--
return array('items' => array('a', 'b'))
--EXPECT--
A
B
--TEST--
"filter" tag applies the filter on "if" tags
--TEMPLATE--
{% filter upper %}
{% if items %}
{{ items|join(', ') }}
{% endif %}

{% if items.3 is defined %}
FOO
{% else %}
{{ items.1 }}
{% endif %}

{% if items.3 is defined %}
FOO
{% elseif items.1 %}
{{ items.0 }}
{% endif %}

{% endfilter %}
--DATA--
return array('items' => array('a', 'b'))
--EXPECT--
A, B

B

A
--TEST--
"for" tag takes a condition
--TEMPLATE--
{% for i in 1..5 if i is odd -%}
    {{ loop.index }}.{{ i }}{{ foo.bar }}
{% endfor %}
--DATA--
return array('foo' => array('bar' => 'X'))
--CONFIG--
return array('strict_variables' => false)
--EXPECT--
1.1X
2.3X
3.5X
--TEST--
"for" tag keeps the context safe
--TEMPLATE--
{% for item in items %}
  {% for item in items %}
    * {{ item }}
  {% endfor %}
  * {{ item }}
{% endfor %}
--DATA--
return array('items' => array('a', 'b'))
--EXPECT--
      * a
      * b
    * a
      * a
      * b
    * b
--TEST--
"for" tag can use an "else" clause
--TEMPLATE--
{% for item in items %}
  * {{ item }}
{% else %}
  no item
{% endfor %}
--DATA--
return array('items' => array('a', 'b'))
--EXPECT--
  * a
  * b
--DATA--
return array('items' => array())
--EXPECT--
  no item
--DATA--
return array()
--CONFIG--
return array('strict_variables' => false)
--EXPECT--
  no item
--TEST--
"for" tag does not reset inner variables
--TEMPLATE--
{% for i in 1..2 %}
  {% for j in 0..2 %}
    {{k}}{% set k = k+1 %} {{ loop.parent.loop.index }}
  {% endfor %}
{% endfor %}
--DATA--
return array('k' => 0)
--EXPECT--
      0 1
      1 1
      2 1
        3 2
      4 2
      5 2
--TEST--
"for" tag can iterate over keys and values
--TEMPLATE--
{% for key, item in items %}
  * {{ key }}/{{ item }}
{% endfor %}
--DATA--
return array('items' => array('a', 'b'))
--EXPECT--
  * 0/a
  * 1/b
--TEST--
"for" tag can iterate over keys
--TEMPLATE--
{% for key in items|keys %}
  * {{ key }}
{% endfor %}
--DATA--
return array('items' => array('a', 'b'))
--EXPECT--
  * 0
  * 1
--TEST--
"for" tag adds a loop variable to the context locally
--TEMPLATE--
{% for item in items %}
{% endfor %}
{% if loop is not defined %}WORKS{% endif %}
--DATA--
return array('items' => array())
--EXPECT--
WORKS
--TEST--
"for" tag adds a loop variable to the context
--TEMPLATE--
{% for item in items %}
  * {{ loop.index }}/{{ loop.index0 }}
  * {{ loop.revindex }}/{{ loop.revindex0 }}
  * {{ loop.first }}/{{ loop.last }}/{{ loop.length }}

{% endfor %}
--DATA--
return array('items' => array('a', 'b'))
--EXPECT--
  * 1/0
  * 2/1
  * 1//2

  * 2/1
  * 1/0
  * /1/2
--TEST--
"for" tag
--TEMPLATE--
{% for i, item in items if loop.last > 0 %}
{% endfor %}
--DATA--
return array('items' => array('a', 'b'))
--EXCEPTION--
Twig_Error_Syntax: The "loop" variable cannot be used in a looping condition in "index.twig" at line 2
--TEST--
"for" tag
--TEMPLATE--
{% for i, item in items if i > 0 %}
    {{ loop.last }}
{% endfor %}
--DATA--
return array('items' => array('a', 'b'))
--EXCEPTION--
Twig_Error_Syntax: The "loop.last" variable is not defined when looping with a condition in "index.twig" at line 3
--TEST--
"for" tag can use an "else" clause
--TEMPLATE--
{% for item in items %}
  {% for item in items1 %}
    * {{ item }}
  {% else %}
    no {{ item }}
  {% endfor %}
{% else %}
  no item1
{% endfor %}
--DATA--
return array('items' => array('a', 'b'), 'items1' => array())
--EXPECT--
no a
        no b
--TEST--
"for" tag iterates over iterable and countable objects
--TEMPLATE--
{% for item in items %}
  * {{ item }}
  * {{ loop.index }}/{{ loop.index0 }}
  * {{ loop.revindex }}/{{ loop.revindex0 }}
  * {{ loop.first }}/{{ loop.last }}/{{ loop.length }}

{% endfor %}

{% for key, value in items %}
  * {{ key }}/{{ value }}
{% endfor %}

{% for key in items|keys %}
  * {{ key }}
{% endfor %}
--DATA--
class ItemsIteratorCountable implements Iterator, Countable
{
  protected $values = array('foo' => 'bar', 'bar' => 'foo');
  public function current() { return current($this->values); }
  public function key() { return key($this->values); }
  public function next() { return next($this->values); }
  public function rewind() { return reset($this->values); }
  public function valid() { return false !== current($this->values); }
  public function count() { return count($this->values); }
}
return array('items' => new ItemsIteratorCountable())
--EXPECT--
  * bar
  * 1/0
  * 2/1
  * 1//2

  * foo
  * 2/1
  * 1/0
  * /1/2


  * foo/bar
  * bar/foo

  * foo
  * bar
--TEST--
"for" tag iterates over iterable objects
--TEMPLATE--
{% for item in items %}
  * {{ item }}
  * {{ loop.index }}/{{ loop.index0 }}
  * {{ loop.first }}

{% endfor %}

{% for key, value in items %}
  * {{ key }}/{{ value }}
{% endfor %}

{% for key in items|keys %}
  * {{ key }}
{% endfor %}
--DATA--
class ItemsIterator implements Iterator
{
  protected $values = array('foo' => 'bar', 'bar' => 'foo');
  public function current() { return current($this->values); }
  public function key() { return key($this->values); }
  public function next() { return next($this->values); }
  public function rewind() { return reset($this->values); }
  public function valid() { return false !== current($this->values); }
}
return array('items' => new ItemsIterator())
--EXPECT--
  * bar
  * 1/0
  * 1

  * foo
  * 2/1
  * 


  * foo/bar
  * bar/foo

  * foo
  * bar
--TEST--
"for" tags can be nested
--TEMPLATE--
{% for key, item in items %}
* {{ key }} ({{ loop.length }}):
{% for value in item %}
  * {{ value }} ({{ loop.length }})
{% endfor %}
{% endfor %}
--DATA--
return array('items' => array('a' => array('a1', 'a2', 'a3'), 'b' => array('b1')))
--EXPECT--
* a (2):
  * a1 (3)
  * a2 (3)
  * a3 (3)
* b (2):
  * b1 (1)
--TEST--
"for" tag iterates over item values
--TEMPLATE--
{% for item in items %}
  * {{ item }}
{% endfor %}
--DATA--
return array('items' => array('a', 'b'))
--EXPECT--
  * a
  * b
--TEST--
global variables
--TEMPLATE--
{% include "included.twig" %}
{% from "included.twig" import foobar %}
{{ foobar() }}
--TEMPLATE(included.twig)--
{% macro foobar() %}
called foobar
{% endmacro %}
--DATA--
return array();
--EXPECT--
called foobar
--TEST--
"if" creates a condition
--TEMPLATE--
{% if a is defined %}
  {{ a }}
{% elseif b is defined %}
  {{ b }}
{% else %}
  NOTHING
{% endif %}
--DATA--
return array('a' => 'a')
--EXPECT--
  a
--DATA--
return array('b' => 'b')
--EXPECT--
  b
--DATA--
return array()
--EXPECT--
  NOTHING
--TEST--
"if" takes an expression as a test
--TEMPLATE--
{% if a < 2 %}
  A1
{% elseif a > 10 %}
  A2
{% else %}
  A3
{% endif %}
--DATA--
return array('a' => 1)
--EXPECT--
  A1
--DATA--
return array('a' => 12)
--EXPECT--
  A2
--DATA--
return array('a' => 7)
--EXPECT--
  A3
--TEST--
"include" tag
--TEMPLATE--
FOO
{% include "foo.twig" %}

BAR
--TEMPLATE(foo.twig)--
FOOBAR
--DATA--
return array()
--EXPECT--
FOO

FOOBAR
BAR
--TEST--
"include" tag allows expressions for the template to include
--TEMPLATE--
FOO
{% include foo %}

BAR
--TEMPLATE(foo.twig)--
FOOBAR
--DATA--
return array('foo' => 'foo.twig')
--EXPECT--
FOO

FOOBAR
BAR
--TEST--
"include" tag
--TEMPLATE--
{% include ["foo.twig", "bar.twig"] ignore missing %}
{% include "foo.twig" ignore missing %}
{% include "foo.twig" ignore missing with {} %}
{% include "foo.twig" ignore missing with {} only %}
--DATA--
return array()
--EXPECT--
--TEST--
"include" tag
--TEMPLATE--
{% extends "base.twig" %}

{% block content %}
    {{ parent() }}
{% endblock %}
--TEMPLATE(base.twig)--
{% block content %}
    {% include "foo.twig" %}
{% endblock %}
--DATA--
return array();
--EXCEPTION--
Twig_Error_Loader: Template "foo.twig" is not defined in "base.twig" at line 3.
--TEST--
"include" tag
--TEMPLATE--
{% include "foo.twig" %}
--DATA--
return array();
--EXCEPTION--
Twig_Error_Loader: Template "foo.twig" is not defined in "index.twig" at line 2.
--TEST--
"include" tag accept variables and only
--TEMPLATE--
{% include "foo.twig" %}
{% include "foo.twig" only %}
{% include "foo.twig" with {'foo1': 'bar'} %}
{% include "foo.twig" with {'foo1': 'bar'} only %}
--TEMPLATE(foo.twig)--
{% for k, v in _context %}{{ k }},{% endfor %}
--DATA--
return array('foo' => 'bar')
--EXPECT--
foo,global,_parent,
global,_parent,
foo,global,foo1,_parent,
foo1,global,_parent,
--TEST--
"include" tag accepts Twig_Template instance
--TEMPLATE--
{% include foo %} FOO
--TEMPLATE(foo.twig)--
BAR
--DATA--
return array('foo' => $twig->loadTemplate('foo.twig'))
--EXPECT--
BAR FOO
--TEST--
"include" tag
--TEMPLATE--
{% include ["foo.twig", "bar.twig"] %}
{% include ["bar.twig", "foo.twig"] %}
--TEMPLATE(foo.twig)--
foo
--DATA--
return array()
--EXPECT--
foo
foo
--TEST--
"include" tag accept variables
--TEMPLATE--
{% include "foo.twig" with {'foo': 'bar'} %}
{% include "foo.twig" with vars %}
--TEMPLATE(foo.twig)--
{{ foo }}
--DATA--
return array('vars' => array('foo' => 'bar'))
--EXPECT--
bar
bar
--TEST--
"extends" tag
--TEMPLATE--
{% extends "foo.twig" %}

{% block content %}
FOO
{% endblock %}
--TEMPLATE(foo.twig)--
{% block content %}{% endblock %}
--DATA--
return array()
--EXPECT--
FOO
--TEST--
block_expr2
--TEMPLATE--
{% extends "base2.twig" %}

{% block element -%}
    Element:
    {{- parent() -}}
{% endblock %}
--TEMPLATE(base2.twig)--
{% extends "base.twig" %}
--TEMPLATE(base.twig)--
{% spaceless %}
{% block element -%}
    <div>
        {%- if item.children is defined %}
            {%- for item in item.children %}
                {{- block('element') -}}
            {% endfor %}
        {%- endif -%}
    </div>
{%- endblock %}
{% endspaceless %}
--DATA--
return array(
    'item' => array(
        'children' => array(
            null,
            null,
        )
    )
)
--EXPECT--
Element:<div>Element:<div></div>Element:<div></div></div>
--TEST--
block_expr
--TEMPLATE--
{% extends "base.twig" %}

{% block element -%}
    Element:
    {{- parent() -}}
{% endblock %}
--TEMPLATE(base.twig)--
{% spaceless %}
{% block element -%}
    <div>
        {%- if item.children is defined %}
            {%- for item in item.children %}
                {{- block('element') -}}
            {% endfor %}
        {%- endif -%}
    </div>
{%- endblock %}
{% endspaceless %}
--DATA--
return array(
    'item' => array(
        'children' => array(
            null,
            null,
        )
    )
)
--EXPECT--
Element:<div>Element:<div></div>Element:<div></div></div>
--TEST--
"extends" tag
--TEMPLATE--
{% extends standalone ? foo : 'bar.twig' %}

{% block content %}{{ parent() }}FOO{% endblock %}
--TEMPLATE(foo.twig)--
{% block content %}FOO{% endblock %}
--TEMPLATE(bar.twig)--
{% block content %}BAR{% endblock %}
--DATA--
return array('foo' => 'foo.twig', 'standalone' => true)
--EXPECT--
FOOFOO
--TEST--
"extends" tag
--TEMPLATE--
{% extends foo %}

{% block content %}
FOO
{% endblock %}
--TEMPLATE(foo.twig)--
{% block content %}{% endblock %}
--DATA--
return array('foo' => 'foo.twig')
--EXPECT--
FOO
--TEST--
"extends" tag
--TEMPLATE--
{% extends "foo.twig" %}
--TEMPLATE(foo.twig)--
{% block content %}FOO{% endblock %}
--DATA--
return array()
--EXPECT--
FOO
--TEST--
"extends" tag
--TEMPLATE--
{% extends ["foo.twig", "bar.twig"] %}
--TEMPLATE(bar.twig)--
{% block content %}
foo
{% endblock %}
--DATA--
return array()
--EXPECT--
foo
--TEST--
"extends" tag
--TEMPLATE--
{% extends "layout.twig" %}{% block content %}{{ parent() }}index {% endblock %}
--TEMPLATE(layout.twig)--
{% extends "base.twig" %}{% block content %}{{ parent() }}layout {% endblock %}
--TEMPLATE(base.twig)--
{% block content %}base {% endblock %}
--DATA--
return array()
--EXPECT--
base layout index
--TEST--
"block" tag
--TEMPLATE--
{% block content %}
    CONTENT
    {%- block subcontent -%}
        SUBCONTENT
    {%- endblock -%}
    ENDCONTENT
{% endblock %}
--TEMPLATE(foo.twig)--
--DATA--
return array()
--EXPECT--
CONTENTSUBCONTENTENDCONTENT
--TEST--
"block" tag
--TEMPLATE--
{% extends "foo.twig" %}

{% block content %}
    {% block subcontent %}
        {% block subsubcontent %}
            SUBSUBCONTENT
        {% endblock %}
    {% endblock %}
{% endblock %}
--TEMPLATE(foo.twig)--
{% block content %}
    {% block subcontent %}
        SUBCONTENT
    {% endblock %}
{% endblock %}
--DATA--
return array()
--EXPECT--
SUBSUBCONTENT
--TEST--
"extends" tag
--TEMPLATE--
{% extends "layout.twig" %}
{% block inside %}INSIDE{% endblock inside %}
--TEMPLATE(layout.twig)--
{% extends "base.twig" %}
{% block body %}
    {% block inside '' %}
{% endblock body %}
--TEMPLATE(base.twig)--
{% block body '' %}
--DATA--
return array()
--EXPECT--
INSIDE
--TEST--
"extends" tag
--TEMPLATE--
{% extends foo ? 'foo.twig' : 'bar.twig' %}
--TEMPLATE(foo.twig)--
FOO
--TEMPLATE(bar.twig)--
BAR
--DATA--
return array('foo' => true)
--EXPECT--
FOO
--DATA--
return array('foo' => false)
--EXPECT--
BAR
--TEST--
"extends" tag
--TEMPLATE--
{% block content %}
    {% extends "foo.twig" %}
{% endblock %}
--EXCEPTION--
Twig_Error_Syntax: Cannot extend from a block in "index.twig" at line 3
--TEST--
"extends" tag
--TEMPLATE--
{% extends "base.twig" %}
{% block content %}{% include "included.twig" %}{% endblock %}

{% block footer %}Footer{% endblock %}
--TEMPLATE(included.twig)--
{% extends "base.twig" %}
{% block content %}Included Content{% endblock %}
--TEMPLATE(base.twig)--
{% block content %}Default Content{% endblock %}

{% block footer %}Default Footer{% endblock %}
--DATA--
return array()
--EXPECT--
Included Content
Default Footer
Footer
--TEST--
"extends" tag
--TEMPLATE--
{% extends "foo.twig" %}

{% block content %}
  {% block inside %}
    INSIDE OVERRIDDEN
  {% endblock %}

  BEFORE
  {{ parent() }}
  AFTER
{% endblock %}
--TEMPLATE(foo.twig)--
{% block content %}
  BAR
{% endblock %}
--DATA--
return array()
--EXPECT--

INSIDE OVERRIDDEN
  
  BEFORE
    BAR

  AFTER
--TEST--
"extends" tag
--TEMPLATE--
{% extends "foo.twig" %}

{% block content %}{{ parent() }}FOO{{ parent() }}{% endblock %}
--TEMPLATE(foo.twig)--
{% block content %}BAR{% endblock %}
--DATA--
return array()
--EXPECT--
BARFOOBAR
--TEST--
"parent" tag
--TEMPLATE--
{% use 'foo.twig' %}

{% block content %}
    {{ parent() }}
{% endblock %}
--TEMPLATE(foo.twig)--
{% block content %}BAR{% endblock %}
--DATA--
return array()
--EXPECT--
BAR
--TEST--
"parent" tag
--TEMPLATE--
{% block content %}
    {{ parent() }}
{% endblock %}
--EXCEPTION--
Twig_Error_Syntax: Calling "parent" on a template that does not extend nor "use" another template is forbidden in "index.twig" at line 3
--TEST--
"extends" tag accepts Twig_Template instance
--TEMPLATE--
{% extends foo %}

{% block content %}
{{ parent() }}FOO
{% endblock %}
--TEMPLATE(foo.twig)--
{% block content %}BAR{% endblock %}
--DATA--
return array('foo' => $twig->loadTemplate('foo.twig'))
--EXPECT--
BARFOO
--TEST--
"parent" function
--TEMPLATE--
{% extends "parent.twig" %}

{% use "use1.twig" %}
{% use "use2.twig" %}

{% block content_parent %}
    {{ parent() }}
{% endblock %}

{% block content_use1 %}
    {{ parent() }}
{% endblock %}

{% block content_use2 %}
    {{ parent() }}
{% endblock %}

{% block content %}
    {{ block('content_use1_only') }}
    {{ block('content_use2_only') }}
{% endblock %}
--TEMPLATE(parent.twig)--
{% block content_parent 'content_parent' %}
{% block content_use1 'content_parent' %}
{% block content_use2 'content_parent' %}
{% block content '' %}
--TEMPLATE(use1.twig)--
{% block content_use1 'content_use1' %}
{% block content_use2 'content_use1' %}
{% block content_use1_only 'content_use1_only' %}
--TEMPLATE(use2.twig)--
{% block content_use2 'content_use2' %}
{% block content_use2_only 'content_use2_only' %}
--DATA--
return array()
--EXPECT--
    content_parent
    content_use1
    content_use2
    content_use1_only
    content_use2_only
--TEST--
"macro" tag
--TEMPLATE--
{% import _self as macros %}

{{ macros.input('username') }}
{{ macros.input('password', null, 'password', 1) }}

{% macro input(name, value, type, size) %}
  <input type="{{ type|default("text") }}" name="{{ name }}" value="{{ value|e|default('') }}" size="{{ size|default(20) }}">
{% endmacro %}
--DATA--
return array()
--EXPECT--
  <input type="text" name="username" value="" size="20">

  <input type="password" name="password" value="" size="1">
--TEST--
"macro" tag supports name for endmacro
--TEMPLATE--
{% import _self as macros %}

{{ macros.foo() }}
{{ macros.bar() }}

{% macro foo() %}foo{% endmacro %}
{% macro bar() %}bar{% endmacro bar %}
--DATA--
return array()
--EXPECT--
foo
bar

--TEST--
"macro" tag
--TEMPLATE--
{% import 'forms.twig' as forms %}

{{ forms.input('username') }}
{{ forms.input('password', null, 'password', 1) }}
--TEMPLATE(forms.twig)--
{% macro input(name, value, type, size) %}
  <input type="{{ type|default("text") }}" name="{{ name }}" value="{{ value|e|default('') }}" size="{{ size|default(20) }}">
{% endmacro %}
--DATA--
return array()
--EXPECT--
  <input type="text" name="username" value="" size="20">

  <input type="password" name="password" value="" size="1">
--TEST--
"macro" tag
--TEMPLATE--
{% from 'forms.twig' import foo %}
{% from 'forms.twig' import foo as foobar, bar %}

{{ foo('foo') }}
{{ foobar('foo') }}
{{ bar('foo') }}
--TEMPLATE(forms.twig)--
{% macro foo(name) %}foo{{ name }}{% endmacro %}
{% macro bar(name) %}bar{{ name }}{% endmacro %}
--DATA--
return array()
--EXPECT--
foofoo
foofoo
barfoo
--TEST--
"macro" tag
--TEMPLATE--
{% from 'forms.twig' import foo %}

{{ foo('foo') }}
{{ foo() }}
--TEMPLATE(forms.twig)--
{% macro foo(name) %}{{ name|default('foo') }}{{ global }}{% endmacro %}
--DATA--
return array()
--EXPECT--
fooglobal
fooglobal
--TEST--
"macro" tag
--TEMPLATE--
{% import _self as forms %}

{{ forms.input('username') }}
{{ forms.input('password', null, 'password', 1) }}

{% macro input(name, value, type, size) %}
  <input type="{{ type|default("text") }}" name="{{ name }}" value="{{ value|e|default('') }}" size="{{ size|default(20) }}">
{% endmacro %}
--DATA--
return array()
--EXPECT--
  <input type="text" name="username" value="" size="20">

  <input type="password" name="password" value="" size="1">
--TEST--
"raw" tag
--TEMPLATE--
{% raw %}
{{ foo }}
{% endraw %}
--DATA--
return array()
--EXPECT--
{{ foo }}
--TEST--
"raw" tag
--TEMPLATE--
{% raw %}
{{ foo }}
{% endverbatim %}
--DATA--
return array()
--EXCEPTION--
Twig_Error_Syntax: Unexpected end of file: Unclosed "raw" block in "index.twig" at line 2
--TEST--
"raw" tag
--TEMPLATE--
1***

{%- raw %}
    {{ 'bla' }}
{% endraw %}

1***
2***

{%- raw -%}
    {{ 'bla' }}
{% endraw %}

2***
3***

{%- raw -%}
    {{ 'bla' }}
{% endraw -%}

3***
4***

{%- raw -%}
    {{ 'bla' }}
{%- endraw %}

4***
5***

{%- raw -%}
    {{ 'bla' }}
{%- endraw -%}

5***
--DATA--
return array()
--EXPECT--
1***
    {{ 'bla' }}


1***
2***{{ 'bla' }}


2***
3***{{ 'bla' }}
3***
4***{{ 'bla' }}

4***
5***{{ 'bla' }}5***
--TEST--
sandbox tag
--TEMPLATE--
{%- sandbox %}
    {%- include "foo.twig" %}
    a
{%- endsandbox %}
--TEMPLATE(foo.twig)--
foo
--EXCEPTION--
Twig_Error_Syntax: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 4
--TEST--
sandbox tag
--TEMPLATE--
{%- sandbox %}
    {%- include "foo.twig" %}

    {% if 1 %}
        {%- include "foo.twig" %}
    {% endif %}
{%- endsandbox %}
--TEMPLATE(foo.twig)--
foo
--EXCEPTION--
Twig_Error_Syntax: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 5
--TEST--
sandbox tag
--TEMPLATE--
{%- sandbox %}
    {%- include "foo.twig" %}
{%- endsandbox %}

{%- sandbox %}
    {%- include "foo.twig" %}
    {%- include "foo.twig" %}
{%- endsandbox %}

{%- sandbox %}{% include "foo.twig" %}{% endsandbox %}
--TEMPLATE(foo.twig)--
foo
--DATA--
return array()
--EXPECT--
foo
foo
foo
foo
--TEST--
"set" tag
--TEMPLATE--
{% set foo = 'foo' %}
{% set bar = 'foo<br />' %}

{{ foo }}
{{ bar }}

{% set foo, bar = 'foo', 'bar' %}

{{ foo }}{{ bar }}
--DATA--
return array()
--EXPECT--
foo
foo&lt;br /&gt;


foobar
--TEST--
"set" tag block empty capture
--TEMPLATE--
{% set foo %}{% endset %}

{% if foo %}FAIL{% endif %}
--DATA--
return array()
--EXPECT--
--TEST--
"set" tag block capture
--TEMPLATE--
{% set foo %}f<br />o<br />o{% endset %}

{{ foo }}
--DATA--
return array()
--EXPECT--
f<br />o<br />o
--TEST--
"set" tag
--TEMPLATE--
{% set foo, bar = 'foo' ~ 'bar', 'bar' ~ 'foo' %}

{{ foo }}
{{ bar }}
--DATA--
return array()
--EXPECT--
foobar
barfoo
--TEST--
"spaceless" tag removes whites between HTML tags
--TEMPLATE--
{% spaceless %}

    <div>   <div>   foo   </div>   </div>

{% endspaceless %}
--DATA--
return array()
--EXPECT--
<div><div>   foo   </div></div>
--TEST--
"§" custom tag
--TEMPLATE--
{% § %}
--DATA--
return array()
--EXPECT--
§
--TEST--
Whitespace trimming on tags.
--TEMPLATE--
{{ 5 * '{#-'|length }}
{{ '{{-'|length * 5 + '{%-'|length }}

Trim on control tag:
{% for i in range(1, 9) -%}
	{{ i }}
{%- endfor %}


Trim on output tag:
{% for i in range(1, 9) %}
	{{- i -}}
{% endfor %}


Trim comments:
      
{#- Invisible -#}
       
After the comment.

Trim leading space:
{% if leading %}

		{{- leading }}
{% endif %}

{%- if leading %}
	{{- leading }}

{%- endif %}


Trim trailing space:
{% if trailing -%}          
	{{ trailing -}}

{% endif -%}

Combined:

{%- if both -%}
<ul>
	<li>    {{- both -}}   </li>
</ul>

{%- endif -%}

end
--DATA--
return array('leading' => 'leading space', 'trailing' => 'trailing space', 'both' => 'both')
--EXPECT--
15
18

Trim on control tag:
123456789

Trim on output tag:
123456789

Trim comments:After the comment.

Trim leading space:
leading space
leading space

Trim trailing space:
trailing spaceCombined:<ul>
	<li>both</li>
</ul>end
--TEST--
"use" tag
--TEMPLATE--
{% use "blocks.twig" with content as foo %}

{{ block('foo') }}
--TEMPLATE(blocks.twig)--
{% block content 'foo' %}
--DATA--
return array()
--EXPECT--
foo
--TEST--
"use" tag
--TEMPLATE--
{% use "blocks.twig" %}

{{ block('content') }}
--TEMPLATE(blocks.twig)--
{% block content 'foo' %}
--DATA--
return array()
--EXPECT--
foo
--TEST--
"use" tag
--TEMPLATE--
{% use "foo.twig" %}
--TEMPLATE(foo.twig)--
{% use "bar.twig" %}
--TEMPLATE(bar.twig)--
--DATA--
return array()
--EXPECT--
--TEST--
"use" tag
--TEMPLATE--
{% use "foo.twig" %}

{{ block('content') }}
{{ block('foo') }}
{{ block('bar') }}
--TEMPLATE(foo.twig)--
{% use "bar.twig" %}

{% block content 'foo' %}
{% block foo 'foo' %}
--TEMPLATE(bar.twig)--
{% block content 'bar' %}
{% block bar 'bar' %}
--DATA--
return array()
--EXPECT--
foo
foo
bar
--TEST--
"use" tag
--TEMPLATE--
{% use "ancestor.twig" %}
{% use "parent.twig" %}

{{ block('container') }}
--TEMPLATE(parent.twig)--
{% block sub_container %}
    <div class="overriden_sub_container">overriden sub_container</div>
{% endblock %}
--TEMPLATE(ancestor.twig)--
{% block container %}
    <div class="container">{{ block('sub_container') }}</div>
{% endblock %}

{% block sub_container %}
    <div class="sub_container">sub_container</div>
{% endblock %}
--DATA--
return array()
--EXPECT--
<div class="container">    <div class="overriden_sub_container">overriden sub_container</div>
</div>
--TEST--
"use" tag
--TEMPLATE--
{% use "parent.twig" %}

{{ block('container') }}
--TEMPLATE(parent.twig)--
{% use "ancestor.twig" %}

{% block sub_container %}
    <div class="overriden_sub_container">overriden sub_container</div>
{% endblock %}
--TEMPLATE(ancestor.twig)--
{% block container %}
    <div class="container">{{ block('sub_container') }}</div>
{% endblock %}

{% block sub_container %}
    <div class="sub_container">sub_container</div>
{% endblock %}
--DATA--
return array()
--EXPECT--
<div class="container">    <div class="overriden_sub_container">overriden sub_container</div>
</div>
--TEST--
"use" tag
--TEMPLATE--
{% use "foo.twig" with content as foo_content %}
{% use "bar.twig" %}

{{ block('content') }}
{{ block('foo') }}
{{ block('bar') }}
{{ block('foo_content') }}
--TEMPLATE(foo.twig)--
{% block content 'foo' %}
{% block foo 'foo' %}
--TEMPLATE(bar.twig)--
{% block content 'bar' %}
{% block bar 'bar' %}
--DATA--
return array()
--EXPECT--
bar
foo
bar
foo
--TEST--
"use" tag
--TEMPLATE--
{% use "foo.twig" %}
{% use "bar.twig" %}

{{ block('content') }}
{{ block('foo') }}
{{ block('bar') }}
--TEMPLATE(foo.twig)--
{% block content 'foo' %}
{% block foo 'foo' %}
--TEMPLATE(bar.twig)--
{% block content 'bar' %}
{% block bar 'bar' %}
--DATA--
return array()
--EXPECT--
bar
foo
bar
--TEST--
"use" tag
--TEMPLATE--
{% use 'file2.html.twig'%}
{% block foobar %}
    {{- parent() -}}
    Content of block (second override)
{% endblock foobar %}
--TEMPLATE(file2.html.twig)--
{% use 'file1.html.twig' %}
{% block foobar %}
    {{- parent() -}}
    Content of block (first override)
{% endblock foobar %}
--TEMPLATE(file1.html.twig)--
{% block foobar -%}
    Content of block
{% endblock foobar %}
--DATA--
return array()
--EXPECT--
Content of block
Content of block (first override)
Content of block (second override)
--TEST--
"use" tag
--TEMPLATE--
{% use 'file2.html.twig' %}
{% use 'file1.html.twig' with foo %}
{% block foo %}
    {{- parent() -}}
    Content of foo (second override)
{% endblock foo %}
{% block bar %}
    {{- parent() -}}
    Content of bar (second override)
{% endblock bar %}
--TEMPLATE(file2.html.twig)--
{% use 'file1.html.twig' %}
{% block foo %}
    {{- parent() -}}
    Content of foo (first override)
{% endblock foo %}
{% block bar %}
    {{- parent() -}}
    Content of bar (first override)
{% endblock bar %}
--TEMPLATE(file1.html.twig)--
{% block foo -%}
    Content of foo
{% endblock foo %}
{% block bar -%}
    Content of bar
{% endblock bar %}
--DATA--
return array()
--EXPECT--
Content of foo
Content of foo (first override)
Content of foo (second override)
Content of bar
Content of bar (second override)
--TEST--
"use" tag
--TEMPLATE--
{% use 'file2.html.twig' with foobar as base_base_foobar %}
{% block foobar %}
    {{- block('base_base_foobar') -}}
    Content of block (second override)
{% endblock foobar %}
--TEMPLATE(file2.html.twig)--
{% use 'file1.html.twig' with foobar as base_foobar %}
{% block foobar %}
    {{- block('base_foobar') -}}
    Content of block (first override)
{% endblock foobar %}
--TEMPLATE(file1.html.twig)--
{% block foobar -%}
    Content of block
{% endblock foobar %}
--DATA--
return array()
--EXPECT--
Content of block
Content of block (first override)
Content of block (second override)
--TEST--
"verbatim" tag
--TEMPLATE--
{% verbatim %}
{{ foo }}
{% endverbatim %}
--DATA--
return array()
--EXPECT--
{{ foo }}
--TEST--
"verbatim" tag
--TEMPLATE--
{% verbatim %}
{{ foo }}
{% endraw %}
--DATA--
return array()
--EXCEPTION--
Twig_Error_Syntax: Unexpected end of file: Unclosed "verbatim" block in "index.twig" at line 2
--TEST--
"verbatim" tag
--TEMPLATE--
1***

{%- verbatim %}
    {{ 'bla' }}
{% endverbatim %}

1***
2***

{%- verbatim -%}
    {{ 'bla' }}
{% endverbatim %}

2***
3***

{%- verbatim -%}
    {{ 'bla' }}
{% endverbatim -%}

3***
4***

{%- verbatim -%}
    {{ 'bla' }}
{%- endverbatim %}

4***
5***

{%- verbatim -%}
    {{ 'bla' }}
{%- endverbatim -%}

5***
--DATA--
return array()
--EXPECT--
1***
    {{ 'bla' }}


1***
2***{{ 'bla' }}


2***
3***{{ 'bla' }}
3***
4***{{ 'bla' }}

4***
5***{{ 'bla' }}5***
--TEST--
array index test
--TEMPLATE--
{% for key, value in days %}
{{ key }}
{% endfor %}
--DATA--
return array('days' => array(
    1  => array('money' => 9),
    2  => array('money' => 21),
    3  => array('money' => 38),
    4  => array('money' => 6),
    18 => array('money' => 6),
    19 => array('money' => 3),
    31 => array('money' => 11),
));
--EXPECT--
1
2
3
4
18
19
31
--TEST--
"const" test
--TEMPLATE--
{{ 8 is constant('E_NOTICE') ? 'ok' : 'no' }}
{{ 'bar' is constant('TwigTestFoo::BAR_NAME') ? 'ok' : 'no' }}
{{ value is constant('TwigTestFoo::BAR_NAME') ? 'ok' : 'no' }}
{{ 2 is constant('ARRAY_AS_PROPS', object) ? 'ok' : 'no' }}
--DATA--
return array('value' => 'bar', 'object' => new ArrayObject(array('hi')));
--EXPECT--
ok
ok
ok
ok--TEST--
"defined" test
--TEMPLATE--
{{ definedVar                     is     defined ? 'ok' : 'ko' }}
{{ definedVar                     is not defined ? 'ko' : 'ok' }}
{{ undefinedVar                   is     defined ? 'ko' : 'ok' }}
{{ undefinedVar                   is not defined ? 'ok' : 'ko' }}
{{ zeroVar                        is     defined ? 'ok' : 'ko' }}
{{ nullVar                        is     defined ? 'ok' : 'ko' }}
{{ nested.definedVar              is     defined ? 'ok' : 'ko' }}
{{ nested['definedVar']           is     defined ? 'ok' : 'ko' }}
{{ nested.definedVar              is not defined ? 'ko' : 'ok' }}
{{ nested.undefinedVar            is     defined ? 'ko' : 'ok' }}
{{ nested['undefinedVar']         is     defined ? 'ko' : 'ok' }}
{{ nested.undefinedVar            is not defined ? 'ok' : 'ko' }}
{{ nested.zeroVar                 is     defined ? 'ok' : 'ko' }}
{{ nested.nullVar                 is     defined ? 'ok' : 'ko' }}
{{ nested.definedArray.0          is     defined ? 'ok' : 'ko' }}
{{ nested['definedArray'][0]      is     defined ? 'ok' : 'ko' }}
{{ object.foo                     is     defined ? 'ok' : 'ko' }}
{{ object.undefinedMethod         is     defined ? 'ko' : 'ok' }}
{{ object.getFoo()                is     defined ? 'ok' : 'ko' }}
{{ object.getFoo('a')             is     defined ? 'ok' : 'ko' }}
{{ object.undefinedMethod()       is     defined ? 'ko' : 'ok' }}
{{ object.undefinedMethod('a')    is     defined ? 'ko' : 'ok' }}
{{ object.self.foo                is     defined ? 'ok' : 'ko' }}
{{ object.self.undefinedMethod    is     defined ? 'ko' : 'ok' }}
{{ object.undefinedMethod.self    is     defined ? 'ko' : 'ok' }}
--DATA--
return array(
    'definedVar' => 'defined',
    'zeroVar'    => 0,
    'nullVar'    => null,
    'nested'      => array(
        'definedVar'   => 'defined',
        'zeroVar'      => 0,
        'nullVar'      => null,
        'definedArray' => array(0),
    ),
    'object' => new TwigTestFoo(),
);
--EXPECT--
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
--DATA--
return array(
    'definedVar' => 'defined',
    'zeroVar'    => 0,
    'nullVar'    => null,
    'nested'      => array(
        'definedVar'   => 'defined',
        'zeroVar'      => 0,
        'nullVar'      => null,
        'definedArray' => array(0),
    ),
    'object' => new TwigTestFoo(),
);
--CONFIG--
return array('strict_variables' => false)
--EXPECT--
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
ok
--TEST--
"empty" test
--TEMPLATE--
{{ foo is empty ? 'ok' : 'ko' }}
{{ bar is empty ? 'ok' : 'ko' }}
{{ foobar is empty ? 'ok' : 'ko' }}
{{ array is empty ? 'ok' : 'ko' }}
{{ zero is empty ? 'ok' : 'ko' }}
{{ string is empty ? 'ok' : 'ko' }}
{{ countable_empty is empty ? 'ok' : 'ko' }}
{{ countable_not_empty is empty ? 'ok' : 'ko' }}
{{ markup_empty is empty ? 'ok' : 'ko' }}
{{ markup_not_empty is empty ? 'ok' : 'ko' }}
--DATA--

class CountableStub implements Countable
{
    private $items;

    public function __construct(array $items)
    {
        $this->items = $items;
    }

    public function count()
    {
        return count($this->items);
    }
}
return array(
    'foo' => '', 'bar' => null, 'foobar' => false, 'array' => array(), 'zero' => 0, 'string' => '0',
    'countable_empty' => new CountableStub(array()), 'countable_not_empty' => new CountableStub(array(1, 2)),
    'markup_empty' => new Twig_Markup('', 'UTF-8'), 'markup_not_empty' => new Twig_Markup('test', 'UTF-8'),
);
--EXPECT--
ok
ok
ok
ok
ko
ko
ok
ko
ok
ko
--TEST--
"even" test
--TEMPLATE--
{{ 1 is even ? 'ko' : 'ok' }}
{{ 2 is even ? 'ok' : 'ko' }}
{{ 1 is not even ? 'ok' : 'ko' }}
{{ 2 is not even ? 'ko' : 'ok' }}
--DATA--
return array()
--EXPECT--
ok
ok
ok
ok
--TEST--
Twig supports the in operator
--TEMPLATE--
{% if bar in foo %}
TRUE
{% endif %}
{% if not (bar in foo) %}
{% else %}
TRUE
{% endif %}
{% if bar not in foo %}
{% else %}
TRUE
{% endif %}
{% if 'a' in bar %}
TRUE
{% endif %}
{% if 'c' not in bar %}
TRUE
{% endif %}
{% if '' not in bar %}
TRUE
{% endif %}
{% if '' in '' %}
TRUE
{% endif %}
{% if '0' not in '' %}
TRUE
{% endif %}
{% if 'a' not in '0' %}
TRUE
{% endif %}
{% if '0' in '0' %}
TRUE
{% endif %}
{{ false in [0, 1] ? 'TRUE' : 'FALSE' }}
{{ true in [0, 1] ? 'TRUE' : 'FALSE' }}
{{ '0' in [0, 1] ? 'TRUE' : 'FALSE' }}
{{ '' in [0, 1] ? 'TRUE' : 'FALSE' }}
{{ 0 in ['', 1] ? 'TRUE' : 'FALSE' }}
{{ '' in 'foo' ? 'TRUE' : 'FALSE' }}
{{ 0 in 'foo' ? 'TRUE' : 'FALSE' }}
{{ false in 'foo' ? 'TRUE' : 'FALSE' }}
{{ true in '100' ? 'TRUE' : 'FALSE' }}
{{ [] in 'Array' ? 'TRUE' : 'FALSE' }}
{{ [] in [true, false] ? 'TRUE' : 'FALSE' }}
{{ [] in [true, ''] ? 'TRUE' : 'FALSE' }}
{{ [] in [true, []] ? 'TRUE' : 'FALSE' }}
{{ dir_object in 'foo'~dir_name ? 'TRUE' : 'FALSE' }}
{{ 5 in 125 ? 'TRUE' : 'FALSE' }}
--DATA--
return array('bar' => 'bar', 'foo' => array('bar' => 'bar'), 'dir_name' => dirname(__FILE__), 'dir_object' => new SplFileInfo(dirname(__FILE__)))
--EXPECT--
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
FALSE
FALSE
FALSE
FALSE
FALSE
TRUE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
TRUE
FALSE
FALSE
--TEST--
Twig supports the in operator when using objects
--TEMPLATE--
{% if object in object_list %}
TRUE
{% endif %}
--DATA--
$foo = new TwigTestFoo();
$foo1 = new TwigTestFoo();

$foo->position = $foo1;
$foo1->position = $foo;

return array(
    'object'      => $foo,
    'object_list' => array($foo1, $foo),
);
--EXPECT--
TRUE
--TEST--
"iterable" test
--TEMPLATE--
{{ foo is iterable ? 'ok' : 'ko' }}
{{ traversable is iterable ? 'ok' : 'ko' }}
{{ obj is iterable ? 'ok' : 'ko' }}
{{ val is iterable ? 'ok' : 'ko' }}
--DATA--
return array(
    'foo' => array(),
    'traversable' => new ArrayIterator(array()),
    'obj' => new stdClass(),
    'val' => 'test',
);
--EXPECT--
ok
ok
ko
ko--TEST--
"odd" test
--TEMPLATE--
{{ 1 is odd ? 'ok' : 'ko' }}
{{ 2 is odd ? 'ko' : 'ok' }}
--DATA--
return array()
--EXPECT--
ok
ok

---tokens---
'From the Twig test suite, https://github.com/fabpot/Twig, available under BSD license.\n\n--TEST--\nException for an unclosed tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'foo'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n     '     Other
'{%'          Comment.Preproc
' '           Text
'if'          Keyword
' '           Text
'foo'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n\n\n\n\n         ' Other
'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'i'           Name.Variable
' '           Text
'in'          Keyword
' '           Text
'fo'          Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n\n\n\n         ' Other
'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n\n\n'    Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--EXCEPTION--\nTwig_Error_Syntax: Unexpected tag name "endblock" (expecting closing tag for the "if" tag defined near line 4) in "index.twig" at line 16\n--TEST--\nException for an undefined trait\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'use'         Keyword
' '           Text
"'foo'"       Literal.String.Single
' '           Text
'with'        Name.Variable
' '           Text
'foobar'      Name.Variable
' '           Text
'as'          Name.Variable
' '           Text
'bar'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(foo)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'bar'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--EXCEPTION--\nTwig_Error_Runtime: Block "foobar" is not defined in trait "foo" in "index.twig".\n--TEST--\nTwig supports method calls\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'items'       Name.Variable
'.foo'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'items'       Name.Variable
'['           Operator
"'foo'"       Literal.String.Single
']'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'items'       Name.Variable
'['           Operator
'foo'         Name.Variable
']'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'items'       Name.Variable
'['           Operator
'items'       Name.Variable
'['           Operator
'foo'         Name.Variable
']'           Operator
']'           Operator
' '           Text
'}}'          Comment.Preproc
"\n--DATA--\nreturn array('foo' => 'bar', 'items' => array('foo' => 'bar', 'bar' => 'foo'))\n--EXPECT--\nbar\nbar\nfoo\nbar\n--TEST--\nTwig supports array notation\n--TEMPLATE--\n" Other

'{# empty array #}' Comment
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'['           Operator
']'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"','"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'['           Operator
'1'           Literal.Number
','           Operator
' '           Text
'2'           Literal.Number
']'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"','"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'['           Operator
"'foo'"       Literal.String.Single
','           Operator
' '           Text
'"bar"'       Literal.String.Double
']'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"','"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'{'           Operator
'0'           Literal.Number
':'           Operator
' '           Text
'1'           Literal.Number
','           Operator
' '           Text
"'foo'"       Literal.String.Single
':'           Operator
' '           Text
"'bar'"       Literal.String.Single
'}'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"','"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'{'           Operator
'0'           Literal.Number
':'           Operator
' '           Text
'1'           Literal.Number
','           Operator
' '           Text
"'foo'"       Literal.String.Single
':'           Operator
' '           Text
"'bar'"       Literal.String.Single
'}'           Operator
'|'           Operator
'keys'        Name.Function
'|'           Operator
'join'        Name.Function
'('           Operator
"','"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'{'           Operator
'0'           Literal.Number
':'           Operator
' '           Text
'1'           Literal.Number
','           Operator
' '           Text
'foo'         Name.Variable
':'           Operator
' '           Text
"'bar'"       Literal.String.Single
'}'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"','"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'{'           Operator
'0'           Literal.Number
':'           Operator
' '           Text
'1'           Literal.Number
','           Operator
' '           Text
'foo'         Name.Variable
':'           Operator
' '           Text
"'bar'"       Literal.String.Single
'}'           Operator
'|'           Operator
'keys'        Name.Function
'|'           Operator
'join'        Name.Function
'('           Operator
"','"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{# nested arrays #}' Comment
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'set'         Keyword
' '           Text
'a'           Name.Variable
' '           Text
'='           Operator
' '           Text
'['           Operator
'1'           Literal.Number
','           Operator
' '           Text
'2'           Literal.Number
','           Operator
' '           Text
'['           Operator
'1'           Literal.Number
','           Operator
' '           Text
'2'           Literal.Number
']'           Operator
','           Operator
' '           Text
'{'           Operator
"'foo'"       Literal.String.Single
':'           Operator
' '           Text
'{'           Operator
"'foo'"       Literal.String.Single
':'           Operator
' '           Text
"'bar'"       Literal.String.Single
'}'           Operator
'}'           Operator
']'           Operator
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'a'           Name.Variable
'['           Operator
'2'           Literal.Number
']'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"','"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'a'           Name.Variable
'['           Operator
'3'           Literal.Number
']'           Operator
'['           Operator
'"foo"'       Literal.String.Double
']'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"','"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{# works even if [] is used inside the array #}' Comment
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'['           Operator
'foo'         Name.Variable
'['           Operator
'bar'         Name.Variable
']'           Operator
']'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"','"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{# elements can be any expression #}' Comment
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'['           Operator
"'foo'"       Literal.String.Single
'|'           Operator
'upper'       Name.Function
','           Operator
' '           Text
'bar'         Name.Variable
'|'           Operator
'upper'       Name.Function
','           Operator
' '           Text
'bar'         Name.Variable
' '           Text
'=='          Operator
' '           Text
'foo'         Name.Variable
']'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"','"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{# arrays can have a trailing , like in PHP #}' Comment
'\n'          Other

'{{'          Comment.Preproc
'\n  '        Text
'['           Operator
'\n    '      Text
'1'           Literal.Number
','           Operator
'\n    '      Text
'2'           Literal.Number
','           Operator
'\n  '        Text
']'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"','"         Literal.String.Single
')'           Operator
'\n'          Text

'}}'          Comment.Preproc
'\n\n'        Other

'{# keys can be any expression #}' Comment
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'set'         Keyword
' '           Text
'a'           Name.Variable
' '           Text
'='           Operator
' '           Text
'1'           Literal.Number
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'set'         Keyword
' '           Text
'b'           Name.Variable
' '           Text
'='           Operator
' '           Text
'"foo"'       Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'set'         Keyword
' '           Text
'ary'         Name.Variable
' '           Text
'='           Operator
' '           Text
'{'           Operator
' '           Text
'('           Operator
'a'           Name.Variable
')'           Operator
':'           Operator
' '           Text
"'a'"         Literal.String.Single
','           Operator
' '           Text
'('           Operator
'b'           Name.Variable
')'           Operator
':'           Operator
' '           Text
"'b'"         Literal.String.Single
','           Operator
' '           Text
"'c'"         Literal.String.Single
':'           Operator
' '           Text
"'c'"         Literal.String.Single
','           Operator
' '           Text
'('           Operator
'a'           Name.Variable
' '           Text
'~'           Operator
' '           Text
'b'           Name.Variable
')'           Operator
':'           Operator
' '           Text
"'d'"         Literal.String.Single
' '           Text
'}'           Operator
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'ary'         Name.Variable
'|'           Operator
'keys'        Name.Function
'|'           Operator
'join'        Name.Function
'('           Operator
"','"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'ary'         Name.Variable
'|'           Operator
'join'        Name.Function
'('           Operator
"','"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
"\n--DATA--\nreturn array('bar' => 'bar', 'foo' => array('bar' => 'bar'))\n--EXPECT--\n1,2\nfoo,bar\n1,bar\n0,foo\n\n1,bar\n0,foo\n\n1,2\nbar\n\nbar\n\nFOO,BAR,\n\n1,2\n\n1,foo,c,1foo\na,b,c,d\n--TEST--\nTwig supports binary operations (+, -, *, /, ~, %, and, or)\n--TEMPLATE--\n" Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'+'           Operator
' '           Text
'1'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'2'           Literal.Number
' '           Text
'-'           Operator
' '           Text
'1'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'2'           Literal.Number
' '           Text
'*'           Operator
' '           Text
'2'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'2'           Literal.Number
' '           Text
'/'           Operator
' '           Text
'2'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'3'           Literal.Number
' '           Text
'%'           Operator
' '           Text
'2'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'and'         Keyword
' '           Text
'1'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'and'         Keyword
' '           Text
'0'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'0'           Literal.Number
' '           Text
'and'         Keyword
' '           Text
'1'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'0'           Literal.Number
' '           Text
'and'         Keyword
' '           Text
'0'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'or'          Keyword
' '           Text
'1'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'or'          Keyword
' '           Text
'0'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'0'           Literal.Number
' '           Text
'or'          Keyword
' '           Text
'1'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'0'           Literal.Number
' '           Text
'or'          Keyword
' '           Text
'0'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'0'           Literal.Number
' '           Text
'or'          Keyword
' '           Text
'1'           Literal.Number
' '           Text
'and'         Keyword
' '           Text
'0'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'or'          Keyword
' '           Text
'0'           Literal.Number
' '           Text
'and'         Keyword
' '           Text
'1'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'"foo"'       Literal.String.Double
' '           Text
'~'           Operator
' '           Text
'"bar"'       Literal.String.Double
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
' '           Text
'~'           Operator
' '           Text
'"bar"'       Literal.String.Double
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'"foo"'       Literal.String.Double
' '           Text
'~'           Operator
' '           Text
'bar'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
' '           Text
'~'           Operator
' '           Text
'bar'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'2'           Literal.Number
'0'           Literal.Number
' '           Text
'/'           Operator
'/'           Operator
' '           Text
'7'           Literal.Number
' '           Text
'}}'          Comment.Preproc
"\n--DATA--\nreturn array('foo' => 'bar', 'bar' => 'foo')\n--EXPECT--\n2\n1\n4\n1\n1\n1\n\n\n\n1\n1\n1\n\n\n1\nfoobar\nbarbar\nfoofoo\nbarfoo\n2\n--TEST--\nTwig supports bitwise operations\n--TEMPLATE--\n" Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'b-and'       Keyword
' '           Text
'5'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'b-or'        Keyword
' '           Text
'5'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'b-xor'       Keyword
' '           Text
'5'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'('           Operator
'1'           Literal.Number
' '           Text
'and'         Keyword
' '           Text
'0'           Literal.Number
' '           Text
'b-or'        Keyword
' '           Text
'0'           Literal.Number
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
'1'           Literal.Number
' '           Text
'and'         Keyword
' '           Text
'('           Operator
'0'           Literal.Number
' '           Text
'b-or'        Keyword
' '           Text
'0'           Literal.Number
')'           Operator
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n1\n5\n4\nok\n--TEST--\nTwig supports comparison operators (==, !=, <, >, >=, <=)\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'>'           Operator
' '           Text
'2'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'/'           Other
'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'>'           Operator
' '           Text
'1'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'/'           Other
'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'>='          Operator
' '           Text
'2'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'/'           Other
'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'>='          Operator
' '           Text
'1'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'<'           Operator
' '           Text
'2'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'/'           Other
'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'<'           Operator
' '           Text
'1'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'/'           Other
'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'<='          Operator
' '           Text
'2'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'/'           Other
'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'<='          Operator
' '           Text
'1'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'=='          Operator
' '           Text
'1'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'/'           Other
'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'=='          Operator
' '           Text
'2'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'!='          Operator
' '           Text
'1'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'/'           Other
'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'!='          Operator
' '           Text
'2'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n///1\n1//1/1\n1/\n/1\n--TEST--\nTwig supports the "divisible by" operator\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'8'           Literal.Number
' '           Text
'is'          Keyword
' '           Text
'divisible'   Name.Function
' '           Text
'by'          Name.Variable
'('           Operator
'2'           Literal.Number
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'8'           Literal.Number
' '           Text
'is'          Keyword
' '           Text
'not'         Keyword
' '           Text
'divisible'   Name.Function
' '           Text
'by'          Name.Variable
'('           Operator
'3'           Literal.Number
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'8'           Literal.Number
' '           Text
'is'          Keyword
'    '        Text
'divisible'   Name.Function
'   '         Text
'by'          Name.Variable
'   '         Text
'('           Operator
'2'           Literal.Number
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'8'           Literal.Number
' '           Text
'is'          Keyword
' '           Text
'not'         Keyword
'\n   '       Text
'divisible'   Name.Function
'\n   '       Text
'by'          Name.Variable
'\n   '       Text
'('           Operator
'3'           Literal.Number
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nOK\nOK\nOK\nOK\n--TEST--\nTwig supports the .. operator\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'i'           Name.Variable
' '           Text
'in'          Keyword
' '           Text
'0.'          Literal.Number
'.10'         Literal.Number
' '           Text
'%}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'i'           Name.Variable
' '           Text
'}}'          Comment.Preproc
' '           Other
'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'letter'      Name.Variable
' '           Text
'in'          Keyword
' '           Text
"'a'"         Literal.String.Single
'..'          Operator
"'z'"         Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'letter'      Name.Variable
' '           Text
'}}'          Comment.Preproc
' '           Other
'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'letter'      Name.Variable
' '           Text
'in'          Keyword
' '           Text
"'a'"         Literal.String.Single
'|'           Operator
'upper'       Name.Function
'..'          Operator
"'z'"         Literal.String.Single
'|'           Operator
'upper'       Name.Function
' '           Text
'%}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'letter'      Name.Variable
' '           Text
'}}'          Comment.Preproc
' '           Other
'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'i'           Name.Variable
' '           Text
'in'          Keyword
' '           Text
'foo'         Name.Variable
'['           Operator
'0'           Literal.Number
']'           Operator
'..'          Operator
'foo'         Name.Variable
'['           Operator
'1'           Literal.Number
']'           Operator
' '           Text
'%}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'i'           Name.Variable
' '           Text
'}}'          Comment.Preproc
' '           Other
'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'i'           Name.Variable
' '           Text
'in'          Keyword
' '           Text
'0'           Literal.Number
' '           Text
'+'           Operator
' '           Text
'1'           Literal.Number
' '           Text
'..'          Operator
' '           Text
'1'           Literal.Number
'0'           Literal.Number
' '           Text
'-'           Operator
' '           Text
'1'           Literal.Number
' '           Text
'%}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'i'           Name.Variable
' '           Text
'}}'          Comment.Preproc
' '           Other
'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'foo\' => array(1, 10))\n--EXPECT--\n0 1 2 3 4 5 6 7 8 9 10 \na b c d e f g h i j k l m n o p q r s t u v w x y z \nA B C D E F G H I J K L M N O P Q R S T U V W X Y Z \n1 2 3 4 5 6 7 8 9 10 \n1 2 3 4 5 6 7 8 9\n--TEST--\nTwig supports the "ends with" operator\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
"'foo'"       Literal.String.Single
' '           Text
'ends with'   Keyword
' '           Text
"'o'"         Literal.String.Single
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'not'         Keyword
' '           Text
'('           Operator
"'foo'"       Literal.String.Single
' '           Text
'ends with'   Keyword
' '           Text
"'f'"         Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'not'         Keyword
' '           Text
'('           Operator
"'foo'"       Literal.String.Single
' '           Text
'ends with'   Keyword
' '           Text
"'foowaytoolong'" Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'foo'"       Literal.String.Single
' '           Text
'ends with'   Keyword
' '           Text
"''"          Literal.String.Single
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'1'"         Literal.String.Single
' '           Text
'ends with'   Keyword
' '           Text
'true'        Keyword.Pseudo
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'ends with'   Keyword
' '           Text
'true'        Keyword.Pseudo
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'0'           Literal.Number
' '           Text
'ends with'   Keyword
' '           Text
'false'       Keyword.Pseudo
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"''"          Literal.String.Single
' '           Text
'ends with'   Keyword
' '           Text
'false'       Keyword.Pseudo
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'false'       Keyword.Pseudo
' '           Text
'ends with'   Keyword
' '           Text
'false'       Keyword.Pseudo
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'false'       Keyword.Pseudo
' '           Text
'ends with'   Keyword
' '           Text
"''"          Literal.String.Single
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nOK\nOK\nOK\nOK\nKO\nKO\nKO\nKO\nKO\nKO\n--TEST--\nTwig supports grouping of expressions\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'('           Operator
'2'           Literal.Number
' '           Text
'+'           Operator
' '           Text
'2'           Literal.Number
')'           Operator
' '           Text
'/'           Operator
' '           Text
'2'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n2\n--TEST--\nTwig supports literals\n--TEMPLATE--\n1 ' Other
'{{'          Comment.Preproc
' '           Text
'true'        Keyword.Pseudo
' '           Text
'}}'          Comment.Preproc
'\n2 '        Other
'{{'          Comment.Preproc
' '           Text
'TRUE'        Keyword.Pseudo
' '           Text
'}}'          Comment.Preproc
'\n3 '        Other
'{{'          Comment.Preproc
' '           Text
'false'       Keyword.Pseudo
' '           Text
'}}'          Comment.Preproc
'\n4 '        Other
'{{'          Comment.Preproc
' '           Text
'FALSE'       Keyword.Pseudo
' '           Text
'}}'          Comment.Preproc
'\n5 '        Other
'{{'          Comment.Preproc
' '           Text
'none'        Keyword.Pseudo
' '           Text
'}}'          Comment.Preproc
'\n6 '        Other
'{{'          Comment.Preproc
' '           Text
'NONE'        Keyword.Pseudo
' '           Text
'}}'          Comment.Preproc
'\n7 '        Other
'{{'          Comment.Preproc
' '           Text
'null'        Keyword.Pseudo
' '           Text
'}}'          Comment.Preproc
'\n8 '        Other
'{{'          Comment.Preproc
' '           Text
'NULL'        Keyword.Pseudo
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n1 1\n2 1\n3 \n4 \n5 \n6 \n7 \n8 \n--TEST--\nTwig supports __call() for attributes\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
'.foo'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
'.bar'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n--EXPECT--\nfoo_from_call\nbar_from_getbar\n--TEST--\nTwig supports the "matches" operator\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
"'foo'"       Literal.String.Single
' '           Text
'matches'     Name.Variable
' '           Text
"'/o/'"       Literal.String.Single
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'foo'"       Literal.String.Single
' '           Text
'matches'     Name.Variable
' '           Text
"'/^fo/'"     Literal.String.Single
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'foo'"       Literal.String.Single
' '           Text
'matches'     Name.Variable
' '           Text
"'/O/i'"      Literal.String.Single
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nOK\nOK\nOK\n--TEST--\nTwig supports method calls\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'items'       Name.Variable
'.foo'        Name.Variable
'.foo'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'items'       Name.Variable
'.foo'        Name.Variable
'.getFoo'     Name.Variable
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'items'       Name.Variable
'.foo'        Name.Variable
'.bar'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'items'       Name.Variable
'.foo'        Name.Variable
'['           Operator
"'bar'"       Literal.String.Single
']'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'items'       Name.Variable
'.foo'        Name.Variable
'.bar'        Name.Variable
'('           Operator
"'a'"         Literal.String.Single
','           Operator
' '           Text
'4'           Literal.Number
'3'           Literal.Number
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'items'       Name.Variable
'.foo'        Name.Variable
'.bar'        Name.Variable
'('           Operator
'foo'         Name.Variable
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'items'       Name.Variable
'.foo'        Name.Variable
'.self'       Name.Variable
'.foo'        Name.Variable
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'items'       Name.Variable
'.foo'        Name.Variable
'.is'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'items'       Name.Variable
'.foo'        Name.Variable
'.in'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'items'       Name.Variable
'.foo'        Name.Variable
'.not'        Name.Variable
' '           Text
'}}'          Comment.Preproc
"\n--DATA--\nreturn array('foo' => 'bar', 'items' => array('foo' => new TwigTestFoo(), 'bar' => 'foo'))\n--CONFIG--\nreturn array('strict_variables' => false)\n--EXPECT--\nfoo\nfoo\nbar\n\nbar_a-43\nbar_bar\nfoo\nis\nin\nnot\n--TEST--\nTwig allows to use named operators as variable names\n--TEMPLATE--\n" Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'match'       Name.Variable
' '           Text
'in'          Keyword
' '           Text
'matches'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
'-'           Operator
' '           Text
'match'       Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'in'          Keyword
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'is'          Name.Variable
' '           Text
'}}'          Comment.Preproc
"\n--DATA--\nreturn array('matches' => array(1, 2, 3), 'in' => 'in', 'is' => 'is')\n--EXPECT--\n1\n2\n3\nin\nis\n--TEST--\nTwig parses postfix expressions\n--TEMPLATE--\n" Other

'{%'          Comment.Preproc
' '           Text
'import'      Keyword
' '           Text
'_self'       Name.Variable
' '           Text
'as'          Name.Variable
' '           Text
'macros'      Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'macro'       Keyword
' '           Text
'foo'         Name.Variable
'('           Operator
')'           Operator
' '           Text
'%}'          Comment.Preproc
'foo'         Other
'{%'          Comment.Preproc
' '           Text
'endmacro'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
"'a'"         Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'a'"         Literal.String.Single
'|'           Operator
'upper'       Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'('           Operator
"'a'"         Literal.String.Single
')'           Operator
'|'           Operator
'upper'       Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'-'           Operator
'1'           Literal.Number
'|'           Operator
'upper'       Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'macros'      Name.Variable
'.foo'        Name.Variable
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'('           Operator
'macros'      Name.Variable
')'           Operator
'.foo'        Name.Variable
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array();\n--EXPECT--\na\nA\nA\n-1\nfoo\nfoo\n--TEST--\nTwig supports the "same as" operator\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
'1'           Literal.Number
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'is'          Keyword
' '           Text
'not'         Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
'true'        Keyword.Pseudo
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
'1'           Literal.Number
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'is'          Keyword
' '           Text
'not'         Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
'true'        Keyword.Pseudo
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'is'          Keyword
'   '         Text
'same'        Name.Function
'    '        Text
'as'          Name.Variable
'   '         Text
'('           Operator
'1'           Literal.Number
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'is'          Keyword
' '           Text
'not'         Keyword
'\n    '      Text
'same'        Name.Function
'\n    '      Text
'as'          Name.Variable
'\n    '      Text
'('           Operator
'true'        Keyword.Pseudo
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nOK\nOK\nOK\nOK\nOK\nOK\n--TEST--\nTwig supports the "starts with" operator\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
"'foo'"       Literal.String.Single
' '           Text
'starts with' Keyword
' '           Text
"'f'"         Literal.String.Single
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'not'         Keyword
' '           Text
'('           Operator
"'foo'"       Literal.String.Single
' '           Text
'starts with' Keyword
' '           Text
"'oo'"        Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'not'         Keyword
' '           Text
'('           Operator
"'foo'"       Literal.String.Single
' '           Text
'starts with' Keyword
' '           Text
"'foowaytoolong'" Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'foo'"       Literal.String.Single
' '           Text
'starts      with' Keyword
' '           Text
"'f'"         Literal.String.Single
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'foo'"       Literal.String.Single
' '           Text
'starts\nwith' Keyword
' '           Text
"'f'"         Literal.String.Single
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'foo'"       Literal.String.Single
' '           Text
'starts with' Keyword
' '           Text
"''"          Literal.String.Single
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'1'"         Literal.String.Single
' '           Text
'starts with' Keyword
' '           Text
'true'        Keyword.Pseudo
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"''"          Literal.String.Single
' '           Text
'starts with' Keyword
' '           Text
'false'       Keyword.Pseudo
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'a'"         Literal.String.Single
' '           Text
'starts with' Keyword
' '           Text
'false'       Keyword.Pseudo
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'false'       Keyword.Pseudo
' '           Text
'starts with' Keyword
' '           Text
"''"          Literal.String.Single
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nOK\nOK\nOK\nOK\nOK\nOK\nKO\nKO\nKO\nKO\n--TEST--\nTwig supports string interpolation\n--TEMPLATE--\n' Other

'{# "foo #{"foo #{bar} baz"} baz" #}' Comment
'\n'          Other

'{# "foo #{bar}#{bar} baz" #}' Comment
"\n--DATA--\nreturn array('bar' => 'BAR');\n--EXPECT--\nfoo foo BAR baz baz\nfoo BARBAR baz\n--TEST--\nTwig supports the ternary operator\n--TEMPLATE--\n" Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'?'           Operator
' '           Text
"'YES'"       Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'0'           Literal.Number
' '           Text
'?'           Operator
' '           Text
"'YES'"       Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nYES\n\n--TEST--\nTwig supports the ternary operator\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
"'YES'"       Literal.String.Single
' '           Text
'?'           Operator
':'           Operator
' '           Text
"'NO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'0'           Literal.Number
' '           Text
'?'           Operator
':'           Operator
' '           Text
"'NO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nYES\nNO\n--TEST--\nTwig supports the ternary operator\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'?'           Operator
' '           Text
"'YES'"       Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'NO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'0'           Literal.Number
' '           Text
'?'           Operator
' '           Text
"'YES'"       Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'NO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'0'           Literal.Number
' '           Text
'?'           Operator
' '           Text
"'YES'"       Literal.String.Single
' '           Text
':'           Operator
' '           Text
'('           Operator
'1'           Literal.Number
' '           Text
'?'           Operator
' '           Text
"'YES1'"      Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'NO1'"       Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'0'           Literal.Number
' '           Text
'?'           Operator
' '           Text
"'YES'"       Literal.String.Single
' '           Text
':'           Operator
' '           Text
'('           Operator
'0'           Literal.Number
' '           Text
'?'           Operator
' '           Text
"'YES1'"      Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'NO1'"       Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'=='          Operator
' '           Text
'1'           Literal.Number
' '           Text
'?'           Operator
' '           Text
"'foo<br />'" Literal.String.Single
":''"         Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
' '           Text
'~'           Operator
' '           Text
'('           Operator
'bar'         Name.Variable
' '           Text
'?'           Operator
' '           Text
'('           Operator
"'-'"         Literal.String.Single
' '           Text
'~'           Operator
' '           Text
'bar'         Name.Variable
')'           Operator
' '           Text
':'           Operator
' '           Text
"''"          Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
"\n--DATA--\nreturn array('foo' => 'foo', 'bar' => 'bar')\n--EXPECT--\nYES\nNO\nYES1\nNO1\nfoo<br />\nfoo-bar\n--TEST--\nTwig does not allow to use two-word named operators as variable names\n--TEMPLATE--\n" Other

'{{'          Comment.Preproc
' '           Text
'starts with' Keyword
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXCEPTION--\nTwig_Error_Syntax: Unexpected token "operator" of value "starts with" in "index.twig" at line 2\n--TEST--\nTwig unary operators precedence\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'-'           Operator
'1'           Literal.Number
' '           Text
'-'           Operator
' '           Text
'1'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'-'           Operator
'1'           Literal.Number
' '           Text
'-'           Operator
' '           Text
'-'           Operator
'1'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'-'           Operator
'1'           Literal.Number
' '           Text
'*'           Operator
' '           Text
'-'           Operator
'1'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'4'           Literal.Number
' '           Text
'/'           Operator
' '           Text
'-'           Operator
'1'           Literal.Number
' '           Text
'*'           Operator
' '           Text
'5'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n-2\n0\n1\n-20\n--TEST--\nTwig supports unary operators (not, -, +)\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'not'         Keyword
' '           Text
'1'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'/'           Other
'{{'          Comment.Preproc
' '           Text
'not'         Keyword
' '           Text
'0'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'+'           Operator
'1'           Literal.Number
' '           Text
'+'           Operator
' '           Text
'1'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'/'           Other
'{{'          Comment.Preproc
' '           Text
'-'           Operator
'1'           Literal.Number
' '           Text
'-'           Operator
' '           Text
'1'           Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'not'         Keyword
' '           Text
'('           Operator
'false'       Keyword.Pseudo
' '           Text
'or'          Keyword
' '           Text
'true'        Keyword.Pseudo
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n/1\n2/-2\n\n--TEST--\n"abs" filter\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'('           Operator
'-'           Operator
'5.5'         Literal.Number
')'           Operator
'|'           Operator
'abs'         Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'('           Operator
'-'           Operator
'5'           Literal.Number
')'           Operator
'|'           Operator
'abs'         Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'('           Operator
'-'           Operator
'0'           Literal.Number
')'           Operator
'|'           Operator
'abs'         Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'0'           Literal.Number
'|'           Operator
'abs'         Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'5'           Literal.Number
'|'           Operator
'abs'         Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'5.5'         Literal.Number
'|'           Operator
'abs'         Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'number1'     Name.Variable
'|'           Operator
'abs'         Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'number2'     Name.Variable
'|'           Operator
'abs'         Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'number3'     Name.Variable
'|'           Operator
'abs'         Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'number4'     Name.Variable
'|'           Operator
'abs'         Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'number5'     Name.Variable
'|'           Operator
'abs'         Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'number6'     Name.Variable
'|'           Operator
'abs'         Name.Function
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\'number1\' => -5.5, \'number2\' => -5, \'number3\' => -0, \'number4\' => 0, \'number5\' => 5, \'number6\' => 5.5)\n--EXPECT--\n5.5\n5\n0\n0\n5\n5.5\n5.5\n5\n0\n0\n5\n5.5\n--TEST--\n"batch" filter\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'row'         Name.Variable
' '           Text
'in'          Keyword
' '           Text
'items'       Name.Variable
'|'           Operator
'batch'       Name.Function
'('           Operator
'3.1'         Literal.Number
')'           Operator
' '           Text
'%}'          Comment.Preproc
'\n  <div class=row>\n  ' Other
'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'column'      Name.Variable
' '           Text
'in'          Keyword
' '           Text
'row'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    <div class=item>' Other
'{{'          Comment.Preproc
' '           Text
'column'      Name.Variable
' '           Text
'}}'          Comment.Preproc
'</div>\n  '  Other
'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n  </div>\n' Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'items\' => array(\'a\', \'b\', \'c\', \'d\', \'e\', \'f\', \'g\', \'h\', \'i\', \'j\'))\n--EXPECT--\n<div class=row>\n      <div class=item>a</div>\n      <div class=item>b</div>\n      <div class=item>c</div>\n      <div class=item>d</div>\n    </div>\n  <div class=row>\n      <div class=item>e</div>\n      <div class=item>f</div>\n      <div class=item>g</div>\n      <div class=item>h</div>\n    </div>\n  <div class=row>\n      <div class=item>i</div>\n      <div class=item>j</div>\n    </div>\n--TEST--\n"batch" filter\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'row'         Name.Variable
' '           Text
'in'          Keyword
' '           Text
'items'       Name.Variable
'|'           Operator
'batch'       Name.Function
'('           Operator
'3'           Literal.Number
')'           Operator
' '           Text
'%}'          Comment.Preproc
'\n  <div class=row>\n  ' Other
'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'column'      Name.Variable
' '           Text
'in'          Keyword
' '           Text
'row'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    <div class=item>' Other
'{{'          Comment.Preproc
' '           Text
'column'      Name.Variable
' '           Text
'}}'          Comment.Preproc
'</div>\n  '  Other
'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n  </div>\n' Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'items\' => array(\'a\', \'b\', \'c\', \'d\', \'e\', \'f\', \'g\', \'h\', \'i\', \'j\'))\n--EXPECT--\n<div class=row>\n      <div class=item>a</div>\n      <div class=item>b</div>\n      <div class=item>c</div>\n    </div>\n  <div class=row>\n      <div class=item>d</div>\n      <div class=item>e</div>\n      <div class=item>f</div>\n    </div>\n  <div class=row>\n      <div class=item>g</div>\n      <div class=item>h</div>\n      <div class=item>i</div>\n    </div>\n  <div class=row>\n      <div class=item>j</div>\n    </div>\n--TEST--\n"batch" filter\n--TEMPLATE--\n<table>\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'row'         Name.Variable
' '           Text
'in'          Keyword
' '           Text
'items'       Name.Variable
'|'           Operator
'batch'       Name.Function
'('           Operator
'3'           Literal.Number
','           Operator
' '           Text
"''"          Literal.String.Single
')'           Operator
' '           Text
'%}'          Comment.Preproc
'\n  <tr>\n  ' Other
'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'column'      Name.Variable
' '           Text
'in'          Keyword
' '           Text
'row'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    <td>'  Other
'{{'          Comment.Preproc
' '           Text
'column'      Name.Variable
' '           Text
'}}'          Comment.Preproc
'</td>\n  '   Other
'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n  </tr>\n' Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n</table>\n--DATA--\nreturn array(\'items\' => array(\'a\', \'b\', \'c\', \'d\', \'e\', \'f\', \'g\', \'h\', \'i\', \'j\'))\n--EXPECT--\n<table>\n  <tr>\n      <td>a</td>\n      <td>b</td>\n      <td>c</td>\n    </tr>\n  <tr>\n      <td>d</td>\n      <td>e</td>\n      <td>f</td>\n    </tr>\n  <tr>\n      <td>g</td>\n      <td>h</td>\n      <td>i</td>\n    </tr>\n  <tr>\n      <td>j</td>\n      <td></td>\n      <td></td>\n    </tr>\n</table>\n--TEST--\n"batch" filter\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'row'         Name.Variable
' '           Text
'in'          Keyword
' '           Text
'items'       Name.Variable
'|'           Operator
'batch'       Name.Function
'('           Operator
'3'           Literal.Number
','           Operator
' '           Text
"'fill'"      Literal.String.Single
')'           Operator
' '           Text
'%}'          Comment.Preproc
'\n  <div class=row>\n  ' Other
'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'column'      Name.Variable
' '           Text
'in'          Keyword
' '           Text
'row'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    <div class=item>' Other
'{{'          Comment.Preproc
' '           Text
'column'      Name.Variable
' '           Text
'}}'          Comment.Preproc
'</div>\n  '  Other
'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n  </div>\n' Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'items\' => array(\'a\', \'b\', \'c\', \'d\', \'e\', \'f\', \'g\', \'h\', \'i\', \'j\', \'k\', \'l\'))\n--EXPECT--\n<div class=row>\n      <div class=item>a</div>\n      <div class=item>b</div>\n      <div class=item>c</div>\n    </div>\n  <div class=row>\n      <div class=item>d</div>\n      <div class=item>e</div>\n      <div class=item>f</div>\n    </div>\n  <div class=row>\n      <div class=item>g</div>\n      <div class=item>h</div>\n      <div class=item>i</div>\n    </div>\n  <div class=row>\n      <div class=item>j</div>\n      <div class=item>k</div>\n      <div class=item>l</div>\n    </div>\n--TEST--\n"batch" filter\n--TEMPLATE--\n<table>\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'row'         Name.Variable
' '           Text
'in'          Keyword
' '           Text
'items'       Name.Variable
'|'           Operator
'batch'       Name.Function
'('           Operator
'3'           Literal.Number
','           Operator
' '           Text
"'fill'"      Literal.String.Single
')'           Operator
' '           Text
'%}'          Comment.Preproc
'\n  <tr>\n  ' Other
'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'column'      Name.Variable
' '           Text
'in'          Keyword
' '           Text
'row'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    <td>'  Other
'{{'          Comment.Preproc
' '           Text
'column'      Name.Variable
' '           Text
'}}'          Comment.Preproc
'</td>\n  '   Other
'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n  </tr>\n' Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n</table>\n--DATA--\nreturn array(\'items\' => array(\'a\', \'b\', \'c\', \'d\', \'e\', \'f\', \'g\', \'h\', \'i\', \'j\'))\n--EXPECT--\n<table>\n  <tr>\n      <td>a</td>\n      <td>b</td>\n      <td>c</td>\n    </tr>\n  <tr>\n      <td>d</td>\n      <td>e</td>\n      <td>f</td>\n    </tr>\n  <tr>\n      <td>g</td>\n      <td>h</td>\n      <td>i</td>\n    </tr>\n  <tr>\n      <td>j</td>\n      <td>fill</td>\n      <td>fill</td>\n    </tr>\n</table>\n--TEST--\n"convert_encoding" filter\n--CONDITION--\nfunction_exists(\'iconv\') || function_exists(\'mb_convert_encoding\')\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'"愛していますか？"'  Literal.String.Double
'|'           Operator
'convert_encoding' Name.Function
'('           Operator
"'ISO-2022-JP'" Literal.String.Single
','           Operator
' '           Text
"'UTF-8'"     Literal.String.Single
')'           Operator
'|'           Operator
'convert_encoding' Name.Function
'('           Operator
"'UTF-8'"     Literal.String.Single
','           Operator
' '           Text
"'ISO-2022-JP'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n愛していますか？\n--TEST--\n"date" filter (interval support as of PHP 5.3)\n--CONDITION--\nversion_compare(phpversion(), \'5.3.0\', \'>=\')\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'date2'       Name.Variable
'|'           Operator
'date'        Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date2'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'%d days'"   Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\ndate_default_timezone_set(\'UTC\');\n$twig->getExtension(\'core\')->setDateFormat(\'Y-m-d\', \'%d days %h hours\');\nreturn array(\n    \'date2\' => new DateInterval(\'P2D\'),\n)\n--EXPECT--\n2 days 0 hours\n2 days\n--TEST--\n"date" filter\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'date1'       Name.Variable
'|'           Operator
'date'        Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date1'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y'"     Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\ndate_default_timezone_set(\'UTC\');\n$twig->getExtension(\'core\')->setDateFormat(\'Y-m-d\', \'%d days %h hours\');\nreturn array(\n    \'date1\' => mktime(13, 45, 0, 10, 4, 2010),\n)\n--EXPECT--\n2010-10-04\n04/10/2010\n--TEST--\n"date" filter\n--CONDITION--\nversion_compare(phpversion(), \'5.5.0\', \'>=\')\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'date1'       Name.Variable
'|'           Operator
'date'        Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date1'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y'"     Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date1'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y H:i:s'" Literal.String.Single
','           Operator
' '           Text
"'Asia/Hong_Kong'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date1'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y H:i:s'" Literal.String.Single
','           Operator
' '           Text
'timezone1'   Name.Variable
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date1'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y H:i:s'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'date2'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y H:i:s P'" Literal.String.Single
','           Operator
' '           Text
"'Europe/Paris'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date2'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y H:i:s P'" Literal.String.Single
','           Operator
' '           Text
"'Asia/Hong_Kong'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date2'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y H:i:s P'" Literal.String.Single
','           Operator
' '           Text
'false'       Keyword.Pseudo
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date2'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'e'"         Literal.String.Single
','           Operator
' '           Text
"'Europe/Paris'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date2'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'e'"         Literal.String.Single
','           Operator
' '           Text
'false'       Keyword.Pseudo
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\ndate_default_timezone_set(\'Europe/Paris\');\nreturn array(\n    \'date1\' => new DateTimeImmutable(\'2010-10-04 13:45\'),\n    \'date2\' => new DateTimeImmutable(\'2010-10-04 13:45\', new DateTimeZone(\'America/New_York\')),\n    \'timezone1\' => new DateTimeZone(\'America/New_York\'),\n)\n--EXPECT--\nOctober 4, 2010 13:45\n04/10/2010\n04/10/2010 19:45:00\n04/10/2010 07:45:00\n04/10/2010 13:45:00\n\n04/10/2010 19:45:00 +02:00\n05/10/2010 01:45:00 +08:00\n04/10/2010 13:45:00 -04:00\nEurope/Paris\nAmerica/New_York\n--TEST--\n"date" filter (interval support as of PHP 5.3)\n--CONDITION--\nversion_compare(phpversion(), \'5.3.0\', \'>=\')\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'date1'       Name.Variable
'|'           Operator
'date'        Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date1'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'%d days %h hours'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date1'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'%d days %h hours'" Literal.String.Single
','           Operator
' '           Text
'timezone1'   Name.Variable
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\ndate_default_timezone_set(\'UTC\');\nreturn array(\n    \'date1\' => new DateInterval(\'P2D\'),\n    // This should have no effect on DateInterval formatting\n    \'timezone1\' => new DateTimeZone(\'America/New_York\'),\n)\n--EXPECT--\n2 days\n2 days 0 hours\n2 days 0 hours\n--TEST--\n"date_modify" filter\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'date1'       Name.Variable
'|'           Operator
'date_modify' Name.Function
'('           Operator
"'-1day'"     Literal.String.Single
')'           Operator
'|'           Operator
'date'        Name.Function
'('           Operator
"'Y-m-d H:i:s'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date2'       Name.Variable
'|'           Operator
'date_modify' Name.Function
'('           Operator
"'-1day'"     Literal.String.Single
')'           Operator
'|'           Operator
'date'        Name.Function
'('           Operator
"'Y-m-d H:i:s'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\ndate_default_timezone_set(\'UTC\');\nreturn array(\n    \'date1\' => \'2010-10-04 13:45\',\n    \'date2\' => new DateTime(\'2010-10-04 13:45\'),\n)\n--EXPECT--\n2010-10-03 13:45:00\n2010-10-03 13:45:00\n--TEST--\n"date" filter\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'date'        Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
'format'      Name.Variable
'='           Operator
"'d/m/Y H:i:s P'" Literal.String.Single
','           Operator
' '           Text
'timezone'    Name.Variable
'='           Operator
"'America/Chicago'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date'        Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
'timezone'    Name.Variable
'='           Operator
"'America/Chicago'" Literal.String.Single
','           Operator
' '           Text
'format'      Name.Variable
'='           Operator
"'d/m/Y H:i:s P'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date'        Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y H:i:s P'" Literal.String.Single
','           Operator
' '           Text
'timezone'    Name.Variable
'='           Operator
"'America/Chicago'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\ndate_default_timezone_set(\'UTC\');\nreturn array(\'date\' => mktime(13, 45, 0, 10, 4, 2010))\n--EXPECT--\n04/10/2010 08:45:00 -05:00\n04/10/2010 08:45:00 -05:00\n04/10/2010 08:45:00 -05:00\n--TEST--\n"date" filter\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'date1'       Name.Variable
'|'           Operator
'date'        Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date1'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y'"     Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date1'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y H:i:s'" Literal.String.Single
','           Operator
' '           Text
"'Asia/Hong_Kong'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date1'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y H:i:s P'" Literal.String.Single
','           Operator
' '           Text
"'Asia/Hong_Kong'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date1'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y H:i:s P'" Literal.String.Single
','           Operator
' '           Text
"'America/Chicago'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date1'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'e'"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date1'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y H:i:s'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'date2'       Name.Variable
'|'           Operator
'date'        Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date2'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y'"     Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date2'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y H:i:s'" Literal.String.Single
','           Operator
' '           Text
"'Asia/Hong_Kong'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date2'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y H:i:s'" Literal.String.Single
','           Operator
' '           Text
'timezone1'   Name.Variable
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date2'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y H:i:s'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'date3'       Name.Variable
'|'           Operator
'date'        Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date3'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y'"     Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'date4'       Name.Variable
'|'           Operator
'date'        Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date4'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y'"     Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'date5'       Name.Variable
'|'           Operator
'date'        Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date5'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y'"     Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'date6'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y H:i:s P'" Literal.String.Single
','           Operator
' '           Text
"'Europe/Paris'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date6'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y H:i:s P'" Literal.String.Single
','           Operator
' '           Text
"'Asia/Hong_Kong'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date6'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y H:i:s P'" Literal.String.Single
','           Operator
' '           Text
'false'       Keyword.Pseudo
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date6'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'e'"         Literal.String.Single
','           Operator
' '           Text
"'Europe/Paris'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date6'       Name.Variable
'|'           Operator
'date'        Name.Function
'('           Operator
"'e'"         Literal.String.Single
','           Operator
' '           Text
'false'       Keyword.Pseudo
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'date7'       Name.Variable
'|'           Operator
'date'        Name.Function
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\ndate_default_timezone_set(\'Europe/Paris\');\nreturn array(\n    \'date1\' => mktime(13, 45, 0, 10, 4, 2010),\n    \'date2\' => new DateTime(\'2010-10-04 13:45\'),\n    \'date3\' => \'2010-10-04 13:45\',\n    \'date4\' => 1286199900, // DateTime::createFromFormat(\'Y-m-d H:i\', \'2010-10-04 13:45\', new DateTimeZone(\'UTC\'))->getTimestamp() -- A unixtimestamp is always GMT\n    \'date5\' => -189291360, // DateTime::createFromFormat(\'Y-m-d H:i\', \'1964-01-02 03:04\', new DateTimeZone(\'UTC\'))->getTimestamp(),\n    \'date6\' => new DateTime(\'2010-10-04 13:45\', new DateTimeZone(\'America/New_York\')),\n    \'date7\' => \'2010-01-28T15:00:00+05:00\',\n    \'timezone1\' => new DateTimeZone(\'America/New_York\'),\n)\n--EXPECT--\nOctober 4, 2010 13:45\n04/10/2010\n04/10/2010 19:45:00\n04/10/2010 19:45:00 +08:00\n04/10/2010 06:45:00 -05:00\nEurope/Paris\n04/10/2010 13:45:00\n\nOctober 4, 2010 13:45\n04/10/2010\n04/10/2010 19:45:00\n04/10/2010 07:45:00\n04/10/2010 13:45:00\n\nOctober 4, 2010 13:45\n04/10/2010\n\nOctober 4, 2010 15:45\n04/10/2010\n\nJanuary 2, 1964 04:04\n02/01/1964\n\n04/10/2010 19:45:00 +02:00\n05/10/2010 01:45:00 +08:00\n04/10/2010 13:45:00 -04:00\nEurope/Paris\nAmerica/New_York\n\nJanuary 28, 2010 11:00\n--TEST--\n"default" filter\n--TEMPLATE--\nVariable:\n' Other

'{{'          Comment.Preproc
' '           Text
'definedVar'  Name.Variable
'                  ' Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'zeroVar'     Name.Variable
'                     ' Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'emptyVar'    Name.Variable
'                    ' Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'nullVar'     Name.Variable
'                     ' Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'undefinedVar' Name.Variable
'                ' Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\nArray access:\n' Other

'{{'          Comment.Preproc
' '           Text
'nested'      Name.Variable
'.definedVar' Name.Variable
'           ' Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'nested'      Name.Variable
'['           Operator
"'definedVar'" Literal.String.Single
']'           Operator
'        '    Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'nested'      Name.Variable
'.zeroVar'    Name.Variable
'              ' Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'nested'      Name.Variable
'.emptyVar'   Name.Variable
'             ' Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'nested'      Name.Variable
'.nullVar'    Name.Variable
'              ' Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'nested'      Name.Variable
'.undefinedVar' Name.Variable
'         '   Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'nested'      Name.Variable
'['           Operator
"'undefinedVar'" Literal.String.Single
']'           Operator
'      '      Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'undefinedVar' Name.Variable
'.foo'        Name.Variable
'            ' Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\nPlain values:\n' Other

'{{'          Comment.Preproc
' '           Text
"'defined'"   Literal.String.Single
'                   ' Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'0'           Literal.Number
'                           ' Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"''"          Literal.String.Single
'                          ' Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'null'        Keyword.Pseudo
'                        ' Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\nPrecedence:\n' Other

'{{'          Comment.Preproc
' '           Text
"'o'"         Literal.String.Single
' '           Text
'~'           Operator
' '           Text
'nullVar'     Name.Variable
'               ' Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'k'"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'o'"         Literal.String.Single
' '           Text
'~'           Operator
' '           Text
'nested'      Name.Variable
'.nullVar'    Name.Variable
'        '    Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'k'"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\nObject methods:\n' Other

'{{'          Comment.Preproc
' '           Text
'object'      Name.Variable
'.foo'        Name.Variable
'                  ' Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'object'      Name.Variable
'.undefinedMethod' Name.Variable
'      '      Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'object'      Name.Variable
'.getFoo'     Name.Variable
'('           Operator
')'           Operator
'             ' Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'object'      Name.Variable
'.getFoo'     Name.Variable
'('           Operator
"'a'"         Literal.String.Single
')'           Operator
'          '  Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'object'      Name.Variable
'.undefinedMethod' Name.Variable
'('           Operator
')'           Operator
'    '        Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'object'      Name.Variable
'.undefinedMethod' Name.Variable
'('           Operator
"'a'"         Literal.String.Single
')'           Operator
' '           Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\nDeep nested:\n' Other

'{{'          Comment.Preproc
' '           Text
'nested'      Name.Variable
'.undefinedVar' Name.Variable
'.foo'        Name.Variable
'.bar'        Name.Variable
' '           Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'nested'      Name.Variable
'.definedArray' Name.Variable
'.0'          Literal.Number
'       '     Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'nested'      Name.Variable
'['           Operator
"'definedArray'" Literal.String.Single
']'           Operator
'['           Operator
'0'           Literal.Number
']'           Operator
'   '         Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'object'      Name.Variable
'.self'       Name.Variable
'.foo'        Name.Variable
'             ' Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'object'      Name.Variable
'.self'       Name.Variable
'.undefinedMethod' Name.Variable
' '           Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'object'      Name.Variable
'.undefinedMethod' Name.Variable
'.self'       Name.Variable
' '           Text
'|'           Operator
'default'     Name.Function
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'same'        Name.Function
' '           Text
'as'          Name.Variable
'('           Operator
"'default'"   Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
"\n--DATA--\nreturn array(\n    'definedVar' => 'defined',\n    'zeroVar'    => 0,\n    'emptyVar'   => '',\n    'nullVar'    => null,\n    'nested'     => array(\n        'definedVar'   => 'defined',\n        'zeroVar'      => 0,\n        'emptyVar'     => '',\n        'nullVar'      => null,\n        'definedArray' => array(0),\n    ),\n    'object' => new TwigTestFoo(),\n)\n--CONFIG--\nreturn array('strict_variables' => false)\n--EXPECT--\nVariable:\nok\nok\nok\nok\nok\nArray access:\nok\nok\nok\nok\nok\nok\nok\nok\nPlain values:\nok\nok\nok\nok\nPrecedence:\nok\nok\nObject methods:\nok\nok\nok\nok\nok\nok\nDeep nested:\nok\nok\nok\nok\nok\nok\n--DATA--\nreturn array(\n    'definedVar' => 'defined',\n    'zeroVar'    => 0,\n    'emptyVar'   => '',\n    'nullVar'    => null,\n    'nested'     => array(\n        'definedVar'   => 'defined',\n        'zeroVar'      => 0,\n        'emptyVar'     => '',\n        'nullVar'      => null,\n        'definedArray' => array(0),\n    ),\n    'object' => new TwigTestFoo(),\n)\n--CONFIG--\nreturn array('strict_variables' => true)\n--EXPECT--\nVariable:\nok\nok\nok\nok\nok\nArray access:\nok\nok\nok\nok\nok\nok\nok\nok\nPlain values:\nok\nok\nok\nok\nPrecedence:\nok\nok\nObject methods:\nok\nok\nok\nok\nok\nok\nDeep nested:\nok\nok\nok\nok\nok\nok\n--TEST--\ndynamic filter\n--TEMPLATE--\n" Other

'{{'          Comment.Preproc
' '           Text
"'bar'"       Literal.String.Single
'|'           Operator
'foo_path'    Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'bar'"       Literal.String.Single
'|'           Operator
'a_foo_b_bar' Name.Function
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nfoo/bar\na/b/bar\n--TEST--\n"escape" filter does not escape with the html strategy when using the html_attr strategy\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
"'<br />'"    Literal.String.Single
'|'           Operator
'escape'      Name.Function
'('           Operator
"'html_attr'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n&lt;br&#x20;&#x2F;&gt;\n--TEST--\n"escape" filter\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'"愛していますか？ <br />"' Literal.String.Double
'|'           Operator
'e'           Name.Function
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n愛していますか？ &lt;br /&gt;\n--TEST--\n"escape" filter\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'"foo <br />"' Literal.String.Double
'|'           Operator
'e'           Name.Function
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nfoo &lt;br /&gt;\n--TEST--\n"first" filter\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'['           Operator
'1'           Literal.Number
','           Operator
' '           Text
'2'           Literal.Number
','           Operator
' '           Text
'3'           Literal.Number
','           Operator
' '           Text
'4'           Literal.Number
']'           Operator
'|'           Operator
'first'       Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'{'           Operator
'a'           Name.Variable
':'           Operator
' '           Text
'1'           Literal.Number
','           Operator
' '           Text
'b'           Name.Variable
':'           Operator
' '           Text
'2'           Literal.Number
','           Operator
' '           Text
'c'           Name.Variable
':'           Operator
' '           Text
'3'           Literal.Number
','           Operator
' '           Text
'd'           Name.Variable
':'           Operator
' '           Text
'4'           Literal.Number
'}'           Operator
'|'           Operator
'first'       Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'1234'"      Literal.String.Single
'|'           Operator
'first'       Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'arr'         Name.Variable
'|'           Operator
'first'       Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'Ä€é'"       Literal.String.Single
'|'           Operator
'first'       Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"''"          Literal.String.Single
'|'           Operator
'first'       Name.Function
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\'arr\' => new ArrayObject(array(1, 2, 3, 4)))\n--EXPECT--\n1\n1\n1\n1\nÄ\n--TEST--\n"escape" filter\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'set'         Keyword
' '           Text
'foo'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    foo<br />\n' Other

'{%'          Comment.Preproc
' '           Text
'endset'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
'|'           Operator
'e'           Name.Function
'('           Operator
"'html'"      Literal.String.Single
')'           Operator
' '           Text
'-'           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
'|'           Operator
'e'           Name.Function
'('           Operator
"'js'"        Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
'true'        Keyword.Pseudo
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n    foo&lt;br /&gt;\n\\x20\\x20\\x20\\x20foo\\x3Cbr\\x20\\x2F\\x3E\\x0A\n        foo<br />\n--TEST--\n"format" filter\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'string'      Name.Variable
'|'           Operator
'format'      Name.Function
'('           Operator
'foo'         Name.Variable
','           Operator
' '           Text
'3'           Literal.Number
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\'string\' => \'%s/%d\', \'foo\' => \'bar\')\n--EXPECT--\nbar/3\n--TEST--\n"join" filter\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'['           Operator
'"foo"'       Literal.String.Double
','           Operator
' '           Text
'"bar"'       Literal.String.Double
']'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"', '"        Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
'|'           Operator
'join'        Name.Function
'('           Operator
"', '"        Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'bar'         Name.Variable
'|'           Operator
'join'        Name.Function
'('           Operator
"', '"        Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\'foo\' => new TwigTestFoo(), \'bar\' => new ArrayObject(array(3, 4)))\n--EXPECT--\nfoo, bar\n1, 2\n3, 4\n--TEST--\n"json_encode" filter\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'"foo"'       Literal.String.Double
'|'           Operator
'json_encode' Name.Function
'|'           Operator
'raw'         Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
'|'           Operator
'json_encode' Name.Function
'|'           Operator
'raw'         Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'['           Operator
'foo'         Name.Variable
','           Operator
' '           Text
'"foo"'       Literal.String.Double
']'           Operator
'|'           Operator
'json_encode' Name.Function
'|'           Operator
'raw'         Name.Function
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\'foo\' => new Twig_Markup(\'foo\', \'UTF-8\'))\n--EXPECT--\n"foo"\n"foo"\n["foo","foo"]\n--TEST--\n"last" filter\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'['           Operator
'1'           Literal.Number
','           Operator
' '           Text
'2'           Literal.Number
','           Operator
' '           Text
'3'           Literal.Number
','           Operator
' '           Text
'4'           Literal.Number
']'           Operator
'|'           Operator
'last'        Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'{'           Operator
'a'           Name.Variable
':'           Operator
' '           Text
'1'           Literal.Number
','           Operator
' '           Text
'b'           Name.Variable
':'           Operator
' '           Text
'2'           Literal.Number
','           Operator
' '           Text
'c'           Name.Variable
':'           Operator
' '           Text
'3'           Literal.Number
','           Operator
' '           Text
'd'           Name.Variable
':'           Operator
' '           Text
'4'           Literal.Number
'}'           Operator
'|'           Operator
'last'        Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'1234'"      Literal.String.Single
'|'           Operator
'last'        Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'arr'         Name.Variable
'|'           Operator
'last'        Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'Ä€é'"       Literal.String.Single
'|'           Operator
'last'        Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"''"          Literal.String.Single
'|'           Operator
'last'        Name.Function
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\'arr\' => new ArrayObject(array(1, 2, 3, 4)))\n--EXPECT--\n4\n4\n4\n4\né\n--TEST--\n"length" filter\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'array'       Name.Variable
'|'           Operator
'length'      Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'string'      Name.Variable
'|'           Operator
'length'      Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'number'      Name.Variable
'|'           Operator
'length'      Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'markup'      Name.Variable
'|'           Operator
'length'      Name.Function
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\'array\' => array(1, 4), \'string\' => \'foo\', \'number\' => 1000, \'markup\' => new Twig_Markup(\'foo\', \'UTF-8\'))\n--EXPECT--\n2\n3\n4\n3\n--TEST--\n"length" filter\n--CONDITION--\nfunction_exists(\'mb_get_info\')\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'string'      Name.Variable
'|'           Operator
'length'      Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'markup'      Name.Variable
'|'           Operator
'length'      Name.Function
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\'string\' => \'été\', \'markup\' => new Twig_Markup(\'foo\', \'UTF-8\'))\n--EXPECT--\n3\n3\n--TEST--\n"merge" filter\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'items'       Name.Variable
'|'           Operator
'merge'       Name.Function
'('           Operator
'{'           Operator
"'bar'"       Literal.String.Single
':'           Operator
' '           Text
"'foo'"       Literal.String.Single
'}'           Operator
')'           Operator
'|'           Operator
'join'        Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'items'       Name.Variable
'|'           Operator
'merge'       Name.Function
'('           Operator
'{'           Operator
"'bar'"       Literal.String.Single
':'           Operator
' '           Text
"'foo'"       Literal.String.Single
'}'           Operator
')'           Operator
'|'           Operator
'keys'        Name.Function
'|'           Operator
'join'        Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'{'           Operator
"'bar'"       Literal.String.Single
':'           Operator
' '           Text
"'foo'"       Literal.String.Single
'}'           Operator
'|'           Operator
'merge'       Name.Function
'('           Operator
'items'       Name.Variable
')'           Operator
'|'           Operator
'join'        Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'{'           Operator
"'bar'"       Literal.String.Single
':'           Operator
' '           Text
"'foo'"       Literal.String.Single
'}'           Operator
'|'           Operator
'merge'       Name.Function
'('           Operator
'items'       Name.Variable
')'           Operator
'|'           Operator
'keys'        Name.Function
'|'           Operator
'join'        Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'numerics'    Name.Variable
'|'           Operator
'merge'       Name.Function
'('           Operator
'['           Operator
'4'           Literal.Number
','           Operator
' '           Text
'5'           Literal.Number
','           Operator
' '           Text
'6'           Literal.Number
']'           Operator
')'           Operator
'|'           Operator
'join'        Name.Function
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\'items\' => array(\'foo\' => \'bar\'), \'numerics\' => array(1, 2, 3))\n--EXPECT--\nbarfoo\nfoobar\nfoobar\nbarfoo\n123456\n--TEST--\n"nl2br" filter\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'"I like Twig.\\nYou will like it too.\\n\\nEverybody like it!"' Literal.String.Double
'|'           Operator
'nl2br'       Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'text'        Name.Variable
'|'           Operator
'nl2br'       Name.Function
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\'text\' => "If you have some <strong>HTML</strong>\\nit will be escaped.")\n--EXPECT--\nI like Twig.<br />\nYou will like it too.<br />\n<br />\nEverybody like it!\nIf you have some &lt;strong&gt;HTML&lt;/strong&gt;<br />\nit will be escaped.\n--TEST--\n"number_format" filter with defaults.\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'2'           Literal.Number
'0'           Literal.Number
'|'           Operator
'number_format' Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'2'           Literal.Number
'0.25'        Literal.Number
'|'           Operator
'number_format' Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'2'           Literal.Number
'0.25'        Literal.Number
'|'           Operator
'number_format' Name.Function
'('           Operator
'1'           Literal.Number
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'2'           Literal.Number
'0.25'        Literal.Number
'|'           Operator
'number_format' Name.Function
'('           Operator
'2'           Literal.Number
','           Operator
' '           Text
"','"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
'0'           Literal.Number
'2'           Literal.Number
'0.25'        Literal.Number
'|'           Operator
'number_format' Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
'0'           Literal.Number
'2'           Literal.Number
'0.25'        Literal.Number
'|'           Operator
'number_format' Name.Function
'('           Operator
'2'           Literal.Number
','           Operator
' '           Text
"','"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
'0'           Literal.Number
'2'           Literal.Number
'0.25'        Literal.Number
'|'           Operator
'number_format' Name.Function
'('           Operator
'2'           Literal.Number
','           Operator
' '           Text
"','"         Literal.String.Single
','           Operator
' '           Text
"'.'"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\n$twig->getExtension(\'core\')->setNumberFormat(2, \'!\', \'=\');\nreturn array();\n--EXPECT--\n20!00\n20!25\n20!3\n20,25\n1=020!25\n1=020,25\n1.020,25\n--TEST--\n"number_format" filter\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'2'           Literal.Number
'0'           Literal.Number
'|'           Operator
'number_format' Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'2'           Literal.Number
'0.25'        Literal.Number
'|'           Operator
'number_format' Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'2'           Literal.Number
'0.25'        Literal.Number
'|'           Operator
'number_format' Name.Function
'('           Operator
'2'           Literal.Number
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'2'           Literal.Number
'0.25'        Literal.Number
'|'           Operator
'number_format' Name.Function
'('           Operator
'2'           Literal.Number
','           Operator
' '           Text
"','"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
'0'           Literal.Number
'2'           Literal.Number
'0.25'        Literal.Number
'|'           Operator
'number_format' Name.Function
'('           Operator
'2'           Literal.Number
','           Operator
' '           Text
"','"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
'0'           Literal.Number
'2'           Literal.Number
'0.25'        Literal.Number
'|'           Operator
'number_format' Name.Function
'('           Operator
'2'           Literal.Number
','           Operator
' '           Text
"','"         Literal.String.Single
','           Operator
' '           Text
"'.'"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array();\n--EXPECT--\n20\n20\n20.25\n20,25\n1,020,25\n1.020,25\n--TEST--\n"replace" filter\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'"I like %this% and %that%."' Literal.String.Double
'|'           Operator
'replace'     Name.Function
'('           Operator
'{'           Operator
"'%this%'"    Literal.String.Single
':'           Operator
' '           Text
'"foo"'       Literal.String.Double
','           Operator
' '           Text
"'%that%'"    Literal.String.Single
':'           Operator
' '           Text
'"bar"'       Literal.String.Double
'}'           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nI like foo and bar.\n--TEST--\n"reverse" filter\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'['           Operator
'1'           Literal.Number
','           Operator
' '           Text
'2'           Literal.Number
','           Operator
' '           Text
'3'           Literal.Number
','           Operator
' '           Text
'4'           Literal.Number
']'           Operator
'|'           Operator
'reverse'     Name.Function
'|'           Operator
'join'        Name.Function
'('           Operator
"''"          Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'1234évènement'" Literal.String.Single
'|'           Operator
'reverse'     Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'arr'         Name.Variable
'|'           Operator
'reverse'     Name.Function
'|'           Operator
'join'        Name.Function
'('           Operator
"''"          Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'{'           Operator
"'a'"         Literal.String.Single
':'           Operator
' '           Text
"'c'"         Literal.String.Single
','           Operator
' '           Text
"'b'"         Literal.String.Single
':'           Operator
' '           Text
"'a'"         Literal.String.Single
'}'           Operator
'|'           Operator
'reverse'     Name.Function
'('           Operator
')'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"','"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'{'           Operator
"'a'"         Literal.String.Single
':'           Operator
' '           Text
"'c'"         Literal.String.Single
','           Operator
' '           Text
"'b'"         Literal.String.Single
':'           Operator
' '           Text
"'a'"         Literal.String.Single
'}'           Operator
'|'           Operator
'reverse'     Name.Function
'('           Operator
'preserveKeys' Name.Variable
'='           Operator
'true'        Keyword.Pseudo
')'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
'glue'        Name.Variable
'='           Operator
"','"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'{'           Operator
"'a'"         Literal.String.Single
':'           Operator
' '           Text
"'c'"         Literal.String.Single
','           Operator
' '           Text
"'b'"         Literal.String.Single
':'           Operator
' '           Text
"'a'"         Literal.String.Single
'}'           Operator
'|'           Operator
'reverse'     Name.Function
'('           Operator
'preserve_keys' Name.Variable
'='           Operator
'true'        Keyword.Pseudo
')'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
'glue'        Name.Variable
'='           Operator
"','"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\'arr\' => new ArrayObject(array(1, 2, 3, 4)))\n--EXPECT--\n4321\ntnemenèvé4321\n4321\na,c\na,c\na,c\n--TEST--\n"round" filter\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'2.7'         Literal.Number
'|'           Operator
'round'       Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'2.1'         Literal.Number
'|'           Operator
'round'       Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'2.1234'      Literal.Number
'|'           Operator
'round'       Name.Function
'('           Operator
'3'           Literal.Number
','           Operator
' '           Text
"'floor'"     Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'2.1'         Literal.Number
'|'           Operator
'round'       Name.Function
'('           Operator
'0'           Literal.Number
','           Operator
' '           Text
"'ceil'"      Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'2'           Literal.Number
'1.3'         Literal.Number
'|'           Operator
'round'       Name.Function
'('           Operator
'-'           Operator
'1'           Literal.Number
')'           Operator
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'2'           Literal.Number
'1.3'         Literal.Number
'|'           Operator
'round'       Name.Function
'('           Operator
'-'           Operator
'1'           Literal.Number
','           Operator
' '           Text
"'ceil'"      Literal.String.Single
')'           Operator
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'2'           Literal.Number
'1.3'         Literal.Number
'|'           Operator
'round'       Name.Function
'('           Operator
'-'           Operator
'1'           Literal.Number
','           Operator
' '           Text
"'floor'"     Literal.String.Single
')'           Operator
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n3\n2\n2.123\n3\n\n20\n30\n20\n--TEST--\n"slice" filter\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'['           Operator
'1'           Literal.Number
','           Operator
' '           Text
'2'           Literal.Number
','           Operator
' '           Text
'3'           Literal.Number
','           Operator
' '           Text
'4'           Literal.Number
']'           Operator
'['           Operator
'1'           Literal.Number
':'           Operator
'2'           Literal.Number
']'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"''"          Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'{'           Operator
'a'           Name.Variable
':'           Operator
' '           Text
'1'           Literal.Number
','           Operator
' '           Text
'b'           Name.Variable
':'           Operator
' '           Text
'2'           Literal.Number
','           Operator
' '           Text
'c'           Name.Variable
':'           Operator
' '           Text
'3'           Literal.Number
','           Operator
' '           Text
'd'           Name.Variable
':'           Operator
' '           Text
'4'           Literal.Number
'}'           Operator
'['           Operator
'1'           Literal.Number
':'           Operator
'2'           Literal.Number
']'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"''"          Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'['           Operator
'1'           Literal.Number
','           Operator
' '           Text
'2'           Literal.Number
','           Operator
' '           Text
'3'           Literal.Number
','           Operator
' '           Text
'4'           Literal.Number
']'           Operator
'['           Operator
'start'       Name.Variable
':'           Operator
'length'      Name.Variable
']'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"''"          Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'['           Operator
'1'           Literal.Number
','           Operator
' '           Text
'2'           Literal.Number
','           Operator
' '           Text
'3'           Literal.Number
','           Operator
' '           Text
'4'           Literal.Number
']'           Operator
'|'           Operator
'slice'       Name.Function
'('           Operator
'1'           Literal.Number
','           Operator
' '           Text
'2'           Literal.Number
')'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"''"          Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'['           Operator
'1'           Literal.Number
','           Operator
' '           Text
'2'           Literal.Number
','           Operator
' '           Text
'3'           Literal.Number
','           Operator
' '           Text
'4'           Literal.Number
']'           Operator
'|'           Operator
'slice'       Name.Function
'('           Operator
'1'           Literal.Number
','           Operator
' '           Text
'2'           Literal.Number
')'           Operator
'|'           Operator
'keys'        Name.Function
'|'           Operator
'join'        Name.Function
'('           Operator
"''"          Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'['           Operator
'1'           Literal.Number
','           Operator
' '           Text
'2'           Literal.Number
','           Operator
' '           Text
'3'           Literal.Number
','           Operator
' '           Text
'4'           Literal.Number
']'           Operator
'|'           Operator
'slice'       Name.Function
'('           Operator
'1'           Literal.Number
','           Operator
' '           Text
'2'           Literal.Number
','           Operator
' '           Text
'true'        Keyword.Pseudo
')'           Operator
'|'           Operator
'keys'        Name.Function
'|'           Operator
'join'        Name.Function
'('           Operator
"''"          Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'{'           Operator
'a'           Name.Variable
':'           Operator
' '           Text
'1'           Literal.Number
','           Operator
' '           Text
'b'           Name.Variable
':'           Operator
' '           Text
'2'           Literal.Number
','           Operator
' '           Text
'c'           Name.Variable
':'           Operator
' '           Text
'3'           Literal.Number
','           Operator
' '           Text
'd'           Name.Variable
':'           Operator
' '           Text
'4'           Literal.Number
'}'           Operator
'|'           Operator
'slice'       Name.Function
'('           Operator
'1'           Literal.Number
','           Operator
' '           Text
'2'           Literal.Number
')'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"''"          Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'{'           Operator
'a'           Name.Variable
':'           Operator
' '           Text
'1'           Literal.Number
','           Operator
' '           Text
'b'           Name.Variable
':'           Operator
' '           Text
'2'           Literal.Number
','           Operator
' '           Text
'c'           Name.Variable
':'           Operator
' '           Text
'3'           Literal.Number
','           Operator
' '           Text
'd'           Name.Variable
':'           Operator
' '           Text
'4'           Literal.Number
'}'           Operator
'|'           Operator
'slice'       Name.Function
'('           Operator
'1'           Literal.Number
','           Operator
' '           Text
'2'           Literal.Number
')'           Operator
'|'           Operator
'keys'        Name.Function
'|'           Operator
'join'        Name.Function
'('           Operator
"''"          Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'1234'"      Literal.String.Single
'|'           Operator
'slice'       Name.Function
'('           Operator
'1'           Literal.Number
','           Operator
' '           Text
'2'           Literal.Number
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'1234'"      Literal.String.Single
'['           Operator
'1'           Literal.Number
':'           Operator
'2'           Literal.Number
']'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'arr'         Name.Variable
'|'           Operator
'slice'       Name.Function
'('           Operator
'1'           Literal.Number
','           Operator
' '           Text
'2'           Literal.Number
')'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"''"          Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'arr'         Name.Variable
'['           Operator
'1'           Literal.Number
':'           Operator
'2'           Literal.Number
']'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"''"          Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'['           Operator
'1'           Literal.Number
','           Operator
' '           Text
'2'           Literal.Number
','           Operator
' '           Text
'3'           Literal.Number
','           Operator
' '           Text
'4'           Literal.Number
']'           Operator
'|'           Operator
'slice'       Name.Function
'('           Operator
'1'           Literal.Number
')'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"''"          Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'['           Operator
'1'           Literal.Number
','           Operator
' '           Text
'2'           Literal.Number
','           Operator
' '           Text
'3'           Literal.Number
','           Operator
' '           Text
'4'           Literal.Number
']'           Operator
'['           Operator
'1'           Literal.Number
':'           Operator
']'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"''"          Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'1234'"      Literal.String.Single
'|'           Operator
'slice'       Name.Function
'('           Operator
'1'           Literal.Number
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'1234'"      Literal.String.Single
'['           Operator
'1'           Literal.Number
':'           Operator
']'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'1234'"      Literal.String.Single
'['           Operator
':'           Operator
'1'           Literal.Number
']'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\'start\' => 1, \'length\' => 2, \'arr\' => new ArrayObject(array(1, 2, 3, 4)))\n--EXPECT--\n23\n23\n23\n23\n01\n12\n23\nbc\n23\n23\n23\n23\n\n234\n234\n234\n234\n1\n--TEST--\n"sort" filter\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'array1'      Name.Variable
'|'           Operator
'sort'        Name.Function
'|'           Operator
'join'        Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'array2'      Name.Variable
'|'           Operator
'sort'        Name.Function
'|'           Operator
'join'        Name.Function
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\'array1\' => array(4, 1), \'array2\' => array(\'foo\', \'bar\'))\n--EXPECT--\n14\nbarfoo\n--TEST--\n"split" filter\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'"one,two,three,four,five"' Literal.String.Double
'|'           Operator
'split'       Name.Function
'('           Operator
"','"         Literal.String.Single
')'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"'-'"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
'|'           Operator
'split'       Name.Function
'('           Operator
"','"         Literal.String.Single
')'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"'-'"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
'|'           Operator
'split'       Name.Function
'('           Operator
"','"         Literal.String.Single
','           Operator
' '           Text
'3'           Literal.Number
')'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"'-'"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'baz'         Name.Variable
'|'           Operator
'split'       Name.Function
'('           Operator
"''"          Literal.String.Single
')'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"'-'"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'baz'         Name.Variable
'|'           Operator
'split'       Name.Function
'('           Operator
"''"          Literal.String.Single
','           Operator
' '           Text
'2'           Literal.Number
')'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"'-'"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
'|'           Operator
'split'       Name.Function
'('           Operator
"','"         Literal.String.Single
','           Operator
' '           Text
'-'           Operator
'2'           Literal.Number
')'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"'-'"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\'foo\' => "one,two,three,four,five", \'baz\' => \'12345\',)\n--EXPECT--\none-two-three-four-five\none-two-three-four-five\none-two-three,four,five\n1-2-3-4-5\n12-34-5\none-two-three--TEST--\n"trim" filter\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'"  I like Twig.  "' Literal.String.Double
'|'           Operator
'trim'        Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'text'        Name.Variable
'|'           Operator
'trim'        Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'"  foo/"'    Literal.String.Double
'|'           Operator
'trim'        Name.Function
'('           Operator
'"/"'         Literal.String.Double
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\'text\' => "  If you have some <strong>HTML</strong> it will be escaped.  ")\n--EXPECT--\nI like Twig.\nIf you have some &lt;strong&gt;HTML&lt;/strong&gt; it will be escaped.\n  foo\n--TEST--\n"url_encode" filter for PHP < 5.4 and HHVM\n--CONDITION--\ndefined(\'PHP_QUERY_RFC3986\')\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'{'           Operator
'foo'         Name.Variable
':'           Operator
' '           Text
'"bar"'       Literal.String.Double
','           Operator
' '           Text
'number'      Name.Variable
':'           Operator
' '           Text
'3'           Literal.Number
','           Operator
' '           Text
'"spéßi%l"'   Literal.String.Double
':'           Operator
' '           Text
'"e%c0d@d"'   Literal.String.Double
','           Operator
' '           Text
'"spa ce"'    Literal.String.Double
':'           Operator
' '           Text
'""'          Literal.String.Double
'}'           Operator
'|'           Operator
'url_encode'  Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'{'           Operator
'foo'         Name.Variable
':'           Operator
' '           Text
'"bar"'       Literal.String.Double
','           Operator
' '           Text
'number'      Name.Variable
':'           Operator
' '           Text
'3'           Literal.Number
','           Operator
' '           Text
'"spéßi%l"'   Literal.String.Double
':'           Operator
' '           Text
'"e%c0d@d"'   Literal.String.Double
','           Operator
' '           Text
'"spa ce"'    Literal.String.Double
':'           Operator
' '           Text
'""'          Literal.String.Double
'}'           Operator
'|'           Operator
'url_encode'  Name.Function
'|'           Operator
'raw'         Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'{'           Operator
'}'           Operator
'|'           Operator
'url_encode'  Name.Function
'|'           Operator
'default'     Name.Function
'('           Operator
'"default"'   Literal.String.Double
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'spéßi%le%c0d@dspa ce'" Literal.String.Single
'|'           Operator
'url_encode'  Name.Function
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nfoo=bar&amp;number=3&amp;sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&amp;spa%20ce=\nfoo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa%20ce=\ndefault\nsp%C3%A9%C3%9Fi%25le%25c0d%40dspa%20ce\n--TEST--\n"url_encode" filter\n--CONDITION--\ndefined(\'PHP_QUERY_RFC3986\')\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'{'           Operator
'foo'         Name.Variable
':'           Operator
' '           Text
'"bar"'       Literal.String.Double
','           Operator
' '           Text
'number'      Name.Variable
':'           Operator
' '           Text
'3'           Literal.Number
','           Operator
' '           Text
'"spéßi%l"'   Literal.String.Double
':'           Operator
' '           Text
'"e%c0d@d"'   Literal.String.Double
','           Operator
' '           Text
'"spa ce"'    Literal.String.Double
':'           Operator
' '           Text
'""'          Literal.String.Double
'}'           Operator
'|'           Operator
'url_encode'  Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'{'           Operator
'foo'         Name.Variable
':'           Operator
' '           Text
'"bar"'       Literal.String.Double
','           Operator
' '           Text
'number'      Name.Variable
':'           Operator
' '           Text
'3'           Literal.Number
','           Operator
' '           Text
'"spéßi%l"'   Literal.String.Double
':'           Operator
' '           Text
'"e%c0d@d"'   Literal.String.Double
','           Operator
' '           Text
'"spa ce"'    Literal.String.Double
':'           Operator
' '           Text
'""'          Literal.String.Double
'}'           Operator
'|'           Operator
'url_encode'  Name.Function
'|'           Operator
'raw'         Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'{'           Operator
'}'           Operator
'|'           Operator
'url_encode'  Name.Function
'|'           Operator
'default'     Name.Function
'('           Operator
'"default"'   Literal.String.Double
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'spéßi%le%c0d@dspa ce'" Literal.String.Single
'|'           Operator
'url_encode'  Name.Function
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nfoo=bar&amp;number=3&amp;sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&amp;spa%20ce=\nfoo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa%20ce=\ndefault\nsp%C3%A9%C3%9Fi%25le%25c0d%40dspa%20ce\n--TEST--\n"attribute" function\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'attribute'   Name.Variable
'('           Operator
'obj'         Name.Variable
','           Operator
' '           Text
'method'      Name.Variable
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'attribute'   Name.Variable
'('           Operator
'array'       Name.Variable
','           Operator
' '           Text
'item'        Name.Variable
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'attribute'   Name.Variable
'('           Operator
'obj'         Name.Variable
','           Operator
' '           Text
'"bar"'       Literal.String.Double
','           Operator
' '           Text
'['           Operator
'"a"'         Literal.String.Double
','           Operator
' '           Text
'"b"'         Literal.String.Double
']'           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'attribute'   Name.Variable
'('           Operator
'obj'         Name.Variable
','           Operator
' '           Text
'"bar"'       Literal.String.Double
','           Operator
' '           Text
'arguments'   Name.Variable
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'attribute'   Name.Variable
'('           Operator
'obj'         Name.Variable
','           Operator
' '           Text
'method'      Name.Variable
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'attribute'   Name.Variable
'('           Operator
'obj'         Name.Variable
','           Operator
' '           Text
'nonmethod'   Name.Variable
')'           Operator
' '           Text
'is'          Keyword
' '           Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\'obj\' => new TwigTestFoo(), \'method\' => \'foo\', \'array\' => array(\'foo\' => \'bar\'), \'item\' => \'foo\', \'nonmethod\' => \'xxx\', \'arguments\' => array(\'a\', \'b\'))\n--EXPECT--\nfoo\nbar\nbar_a-b\nbar_a-b\nok\nko\n--TEST--\n"block" function\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
"'base.twig'" Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'bar'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'BAR'         Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(base.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'foo'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'bar'"       Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'bar'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'BAR_BASE'    Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nBARBAR\n--TEST--\n"constant" function\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'constant'    Name.Variable
'('           Operator
"'DATE_W3C'"  Literal.String.Single
')'           Operator
' '           Text
'=='          Operator
' '           Text
'expect'      Name.Variable
' '           Text
'?'           Operator
' '           Text
"'true'"      Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'false'"     Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'constant'    Name.Variable
'('           Operator
"'ARRAY_AS_PROPS'" Literal.String.Single
','           Operator
' '           Text
'object'      Name.Variable
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\'expect\' => DATE_W3C, \'object\' => new ArrayObject(array(\'hi\')));\n--EXPECT--\ntrue\n2\n--TEST--\n"cycle" function\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'i'           Name.Variable
' '           Text
'in'          Keyword
' '           Text
'0.'          Literal.Number
'.6'          Literal.Number
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'cycle'       Name.Variable
'('           Operator
'array1'      Name.Variable
','           Operator
' '           Text
'i'           Name.Variable
')'           Operator
' '           Text
'}}'          Comment.Preproc
'-'           Other
'{{'          Comment.Preproc
' '           Text
'cycle'       Name.Variable
'('           Operator
'array2'      Name.Variable
','           Operator
' '           Text
'i'           Name.Variable
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'array1\' => array(\'odd\', \'even\'), \'array2\' => array(\'apple\', \'orange\', \'citrus\'))\n--EXPECT--\nodd-apple\neven-orange\nodd-citrus\neven-apple\nodd-orange\neven-citrus\nodd-apple\n--TEST--\n"date" function\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'date'        Name.Variable
'('           Operator
'date'        Name.Variable
','           Operator
' '           Text
'"America/New_York"' Literal.String.Double
')'           Operator
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y H:i:s P'" Literal.String.Single
','           Operator
' '           Text
'false'       Keyword.Pseudo
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date'        Name.Variable
'('           Operator
'timezone'    Name.Variable
'='           Operator
'"America/New_York"' Literal.String.Double
','           Operator
' '           Text
'date'        Name.Variable
'='           Operator
'date'        Name.Variable
')'           Operator
'|'           Operator
'date'        Name.Function
'('           Operator
"'d/m/Y H:i:s P'" Literal.String.Single
','           Operator
' '           Text
'false'       Keyword.Pseudo
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\ndate_default_timezone_set(\'UTC\');\nreturn array(\'date\' => mktime(13, 45, 0, 10, 4, 2010))\n--EXPECT--\n04/10/2010 09:45:00 -04:00\n04/10/2010 09:45:00 -04:00\n--TEST--\n"date" function\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'date'        Name.Variable
'('           Operator
')'           Operator
' '           Text
'=='          Operator
' '           Text
'date'        Name.Variable
'('           Operator
"'now'"       Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date'        Name.Variable
'('           Operator
'date1'       Name.Variable
')'           Operator
' '           Text
'=='          Operator
' '           Text
'date'        Name.Variable
'('           Operator
"'2010-10-04 13:45'" Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date'        Name.Variable
'('           Operator
'date2'       Name.Variable
')'           Operator
' '           Text
'=='          Operator
' '           Text
'date'        Name.Variable
'('           Operator
"'2010-10-04 13:45'" Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date'        Name.Variable
'('           Operator
'date3'       Name.Variable
')'           Operator
' '           Text
'=='          Operator
' '           Text
'date'        Name.Variable
'('           Operator
"'2010-10-04 13:45'" Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date'        Name.Variable
'('           Operator
'date4'       Name.Variable
')'           Operator
' '           Text
'=='          Operator
' '           Text
'date'        Name.Variable
'('           Operator
"'2010-10-04 13:45'" Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'date'        Name.Variable
'('           Operator
'date5'       Name.Variable
')'           Operator
' '           Text
'=='          Operator
' '           Text
'date'        Name.Variable
'('           Operator
"'1964-01-02 03:04'" Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'OK'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'KO'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\ndate_default_timezone_set(\'UTC\');\nreturn array(\n    \'date1\' => mktime(13, 45, 0, 10, 4, 2010),\n    \'date2\' => new DateTime(\'2010-10-04 13:45\'),\n    \'date3\' => \'2010-10-04 13:45\',\n    \'date4\' => 1286199900, // DateTime::createFromFormat(\'Y-m-d H:i\', \'2010-10-04 13:45\', new DateTimeZone(\'UTC\'))->getTimestamp() -- A unixtimestamp is always GMT\n    \'date5\' => -189291360, // DateTime::createFromFormat(\'Y-m-d H:i\', \'1964-01-02 03:04\', new DateTimeZone(\'UTC\'))->getTimestamp(),\n)\n--EXPECT--\nOK\nOK\nOK\nOK\nOK\nOK\n--TEST--\n"dump" function, xdebug is not loaded or xdebug <2.2-dev is loaded\n--CONDITION--\n!extension_loaded(\'xdebug\') || (($r = new ReflectionExtension(\'xdebug\')) && version_compare($r->getVersion(), \'2.2-dev\', \'<\'))\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'dump'        Name.Variable
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\'foo\' => \'foo\', \'bar\' => \'bar\')\n--CONFIG--\nreturn array(\'debug\' => true, \'autoescape\' => false);\n--TEST--\n"dump" function\n--CONDITION--\n!extension_loaded(\'xdebug\')\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'dump'        Name.Variable
'('           Operator
"'foo'"       Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'dump'        Name.Variable
'('           Operator
"'foo'"       Literal.String.Single
','           Operator
' '           Text
"'bar'"       Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\'foo\' => \'foo\', \'bar\' => \'bar\')\n--CONFIG--\nreturn array(\'debug\' => true, \'autoescape\' => false);\n--EXPECT--\nstring(3) "foo"\n\nstring(3) "foo"\nstring(3) "bar"\n--TEST--\ndynamic function\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'foo_path'    Name.Variable
'('           Operator
"'bar'"       Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'a_foo_b_bar' Name.Variable
'('           Operator
"'bar'"       Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nfoo/bar\na/b/bar\n--TEST--\n"include" function\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'set'         Keyword
' '           Text
'tmp'         Name.Variable
' '           Text
'='           Operator
' '           Text
'include'     Name.Variable
'('           Operator
'"foo.twig"'  Literal.String.Double
')'           Operator
' '           Text
'%}'          Comment.Preproc
'\n\nFOO'     Other
'{{'          Comment.Preproc
' '           Text
'tmp'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'BAR\n--TEMPLATE(foo.twig)--\nFOOBAR\n--DATA--\nreturn array()\n--EXPECT--\nFOO\nFOOBARBAR\n--TEST--\n"include" function is safe for auto-escaping\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'include'     Name.Variable
'('           Operator
'"foo.twig"'  Literal.String.Double
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\n<p>Test</p>\n--DATA--\nreturn array()\n--EXPECT--\n<p>Test</p>\n--TEST--\n"include" function\n--TEMPLATE--\nFOO\n' Other

'{{'          Comment.Preproc
' '           Text
'include'     Name.Variable
'('           Operator
'"foo.twig"'  Literal.String.Double
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\nBAR\n--TEMPLATE(foo.twig)--\nFOOBAR\n--DATA--\nreturn array()\n--EXPECT--\nFOO\n\nFOOBAR\n\nBAR\n--TEST--\n"include" function allows expressions for the template to include\n--TEMPLATE--\nFOO\n' Other

'{{'          Comment.Preproc
' '           Text
'include'     Name.Variable
'('           Operator
'foo'         Name.Variable
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\nBAR\n--TEMPLATE(foo.twig)--\nFOOBAR\n--DATA--\nreturn array(\'foo\' => \'foo.twig\')\n--EXPECT--\nFOO\n\nFOOBAR\n\nBAR\n--TEST--\n"include" function\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'include'     Name.Variable
'('           Operator
'['           Operator
'"foo.twig"'  Literal.String.Double
','           Operator
' '           Text
'"bar.twig"'  Literal.String.Double
']'           Operator
','           Operator
' '           Text
'ignore_missing' Name.Variable
' '           Text
'='           Operator
' '           Text
'true'        Keyword.Pseudo
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'include'     Name.Variable
'('           Operator
'"foo.twig"'  Literal.String.Double
','           Operator
' '           Text
'ignore_missing' Name.Variable
' '           Text
'='           Operator
' '           Text
'true'        Keyword.Pseudo
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'include'     Name.Variable
'('           Operator
'"foo.twig"'  Literal.String.Double
','           Operator
' '           Text
'ignore_missing' Name.Variable
' '           Text
'='           Operator
' '           Text
'true'        Keyword.Pseudo
','           Operator
' '           Text
'variables'   Name.Variable
' '           Text
'='           Operator
' '           Text
'{'           Operator
'}'           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'include'     Name.Variable
'('           Operator
'"foo.twig"'  Literal.String.Double
','           Operator
' '           Text
'ignore_missing' Name.Variable
' '           Text
'='           Operator
' '           Text
'true'        Keyword.Pseudo
','           Operator
' '           Text
'variables'   Name.Variable
' '           Text
'='           Operator
' '           Text
'{'           Operator
'}'           Operator
','           Operator
' '           Text
'with_context' Name.Variable
' '           Text
'='           Operator
' '           Text
'true'        Keyword.Pseudo
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n--TEST--\n"include" function\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'"base.twig"' Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(base.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
' '           Text
'include'     Name.Variable
'('           Operator
'"foo.twig"'  Literal.String.Double
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array();\n--EXCEPTION--\nTwig_Error_Loader: Template "foo.twig" is not defined in "base.twig" at line 3.\n--TEST--\n"include" function\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'include'     Name.Variable
'('           Operator
'"foo.twig"'  Literal.String.Double
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array();\n--EXCEPTION--\nTwig_Error_Loader: Template "foo.twig" is not defined in "index.twig" at line 2.\n--TEST--\n"include" tag sandboxed\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'include'     Name.Variable
'('           Operator
'"foo.twig"'  Literal.String.Double
','           Operator
' '           Text
'sandboxed'   Name.Variable
' '           Text
'='           Operator
' '           Text
'true'        Keyword.Pseudo
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\n' Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
'|'           Operator
'e'           Name.Function
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXCEPTION--\nTwig_Sandbox_SecurityError: Filter "e" is not allowed in "index.twig" at line 2.\n--TEST--\n"include" function accepts Twig_Template instance\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'include'     Name.Variable
'('           Operator
'foo'         Name.Variable
')'           Operator
' '           Text
'}}'          Comment.Preproc
' FOO\n--TEMPLATE(foo.twig)--\nBAR\n--DATA--\nreturn array(\'foo\' => $twig->loadTemplate(\'foo.twig\'))\n--EXPECT--\nBAR FOO\n--TEST--\n"include" function\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'include'     Name.Variable
'('           Operator
'['           Operator
'"foo.twig"'  Literal.String.Double
','           Operator
' '           Text
'"bar.twig"'  Literal.String.Double
']'           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
'-'           Operator
' '           Text
'include'     Name.Variable
'('           Operator
'['           Operator
'"bar.twig"'  Literal.String.Double
','           Operator
' '           Text
'"foo.twig"'  Literal.String.Double
']'           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\nfoo\n--DATA--\nreturn array()\n--EXPECT--\nfoo\nfoo\n--TEST--\n"include" function accept variables and with_context\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'include'     Name.Variable
'('           Operator
'"foo.twig"'  Literal.String.Double
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
'-'           Operator
' '           Text
'include'     Name.Variable
'('           Operator
'"foo.twig"'  Literal.String.Double
','           Operator
' '           Text
'with_context' Name.Variable
' '           Text
'='           Operator
' '           Text
'false'       Keyword.Pseudo
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
'-'           Operator
' '           Text
'include'     Name.Variable
'('           Operator
'"foo.twig"'  Literal.String.Double
','           Operator
' '           Text
'{'           Operator
"'foo1'"      Literal.String.Single
':'           Operator
' '           Text
"'bar'"       Literal.String.Single
'}'           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
'-'           Operator
' '           Text
'include'     Name.Variable
'('           Operator
'"foo.twig"'  Literal.String.Double
','           Operator
' '           Text
'{'           Operator
"'foo1'"      Literal.String.Single
':'           Operator
' '           Text
"'bar'"       Literal.String.Single
'}'           Operator
','           Operator
' '           Text
'with_context' Name.Variable
' '           Text
'='           Operator
' '           Text
'false'       Keyword.Pseudo
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'k'           Name.Variable
','           Operator
' '           Text
'v'           Name.Variable
' '           Text
'in'          Keyword
' '           Text
'_context'    Name.Variable
' '           Text
'%}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'k'           Name.Variable
' '           Text
'}}'          Comment.Preproc
','           Other
'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'foo\' => \'bar\')\n--EXPECT--\nfoo,global,_parent,\nglobal,_parent,\nfoo,global,foo1,_parent,\nfoo1,global,_parent,\n--TEST--\n"include" function accept variables\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'include'     Name.Variable
'('           Operator
'"foo.twig"'  Literal.String.Double
','           Operator
' '           Text
'{'           Operator
"'foo'"       Literal.String.Single
':'           Operator
' '           Text
"'bar'"       Literal.String.Single
'}'           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
'-'           Operator
' '           Text
'include'     Name.Variable
'('           Operator
'"foo.twig"'  Literal.String.Double
','           Operator
' '           Text
'vars'        Name.Variable
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\n' Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\'vars\' => array(\'foo\' => \'bar\'))\n--EXPECT--\nbar\nbar\n--TEST--\n"max" function\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'max'         Name.Variable
'('           Operator
'['           Operator
'2'           Literal.Number
','           Operator
' '           Text
'1'           Literal.Number
','           Operator
' '           Text
'3'           Literal.Number
','           Operator
' '           Text
'5'           Literal.Number
','           Operator
' '           Text
'4'           Literal.Number
']'           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'max'         Name.Variable
'('           Operator
'2'           Literal.Number
','           Operator
' '           Text
'1'           Literal.Number
','           Operator
' '           Text
'3'           Literal.Number
','           Operator
' '           Text
'5'           Literal.Number
','           Operator
' '           Text
'4'           Literal.Number
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'max'         Name.Variable
'('           Operator
'{'           Operator
'2'           Literal.Number
':"two"'      Literal.String.Double
','           Operator
' '           Text
'1'           Literal.Number
':"one"'      Literal.String.Double
','           Operator
' '           Text
'3'           Literal.Number
':"three"'    Literal.String.Double
','           Operator
' '           Text
'5'           Literal.Number
':"five"'     Literal.String.Double
','           Operator
' '           Text
'4'           Literal.Number
':"for"'      Literal.String.Double
'}'           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n5\n5\ntwo\n--TEST--\n"min" function\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'min'         Name.Variable
'('           Operator
'2'           Literal.Number
','           Operator
' '           Text
'1'           Literal.Number
','           Operator
' '           Text
'3'           Literal.Number
','           Operator
' '           Text
'5'           Literal.Number
','           Operator
' '           Text
'4'           Literal.Number
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'min'         Name.Variable
'('           Operator
'['           Operator
'2'           Literal.Number
','           Operator
' '           Text
'1'           Literal.Number
','           Operator
' '           Text
'3'           Literal.Number
','           Operator
' '           Text
'5'           Literal.Number
','           Operator
' '           Text
'4'           Literal.Number
']'           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'min'         Name.Variable
'('           Operator
'{'           Operator
'2'           Literal.Number
':"two"'      Literal.String.Double
','           Operator
' '           Text
'1'           Literal.Number
':"one"'      Literal.String.Double
','           Operator
' '           Text
'3'           Literal.Number
':"three"'    Literal.String.Double
','           Operator
' '           Text
'5'           Literal.Number
':"five"'     Literal.String.Double
','           Operator
' '           Text
'4'           Literal.Number
':"for"'      Literal.String.Double
'}'           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n1\n1\nfive\n--TEST--\n"range" function\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'range'       Name.Variable
'('           Operator
'low'         Name.Variable
'='           Operator
'0'           Literal.Number
'+'           Operator
'1'           Literal.Number
','           Operator
' '           Text
'high'        Name.Variable
'='           Operator
'1'           Literal.Number
'0'           Literal.Number
'+'           Operator
'0'           Literal.Number
','           Operator
' '           Text
'step'        Name.Variable
'='           Operator
'2'           Literal.Number
')'           Operator
'|'           Operator
'join'        Name.Function
'('           Operator
"','"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n1,3,5,7,9\n--TEST--\n"block" function recursively called in a parent template\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'"ordered_menu.twig"' Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'label'       Name.Variable
' '           Text
'%}'          Comment.Preproc
'"'           Other
'{{'          Comment.Preproc
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'"'           Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'list'        Name.Variable
' '           Text
'%}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'set'         Keyword
' '           Text
'class'       Name.Variable
' '           Text
'='           Operator
' '           Text
"'b'"         Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(ordered_menu.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'"menu.twig"' Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'list'        Name.Variable
' '           Text
'%}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'set'         Keyword
' '           Text
'class'       Name.Variable
' '           Text
'='           Operator
' '           Text
'class'       Name.Variable
'|'           Operator
'default'     Name.Function
'('           Operator
"'a'"         Literal.String.Single
')'           Operator
' '           Text
'%}'          Comment.Preproc
'<ol class="' Other
'{{'          Comment.Preproc
' '           Text
'class'       Name.Variable
' '           Text
'}}'          Comment.Preproc
'">'          Other
'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'children'"  Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'</ol>'       Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(menu.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'"base.twig"' Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'list'        Name.Variable
' '           Text
'%}'          Comment.Preproc
'<ul>'        Other
'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'children'"  Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'</ul>'       Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'children'    Name.Variable
' '           Text
'%}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'set'         Keyword
' '           Text
'currentItem' Name.Variable
' '           Text
'='           Operator
' '           Text
'item'        Name.Variable
' '           Text
'%}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'item'        Name.Variable
' '           Text
'in'          Keyword
' '           Text
'currentItem' Name.Variable
' '           Text
'%}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'item'"      Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'set'         Keyword
' '           Text
'item'        Name.Variable
' '           Text
'='           Operator
' '           Text
'currentItem' Name.Variable
' '           Text
'%}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'item'        Name.Variable
' '           Text
'%}'          Comment.Preproc
'<li>'        Other
'{%'          Comment.Preproc
' '           Text
'if'          Keyword
' '           Text
'item'        Name.Variable
' '           Text
'is'          Keyword
' '           Text
'not'         Keyword
' '           Text
'iterable'    Name.Function
' '           Text
'%}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'label'"     Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'else'        Keyword
' '           Text
'%}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'list'"      Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'endif'       Keyword
' '           Text
'%}'          Comment.Preproc
'</li>'       Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'label'       Name.Variable
' '           Text
'%}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'item'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'unknown'"   Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(base.twig)--\n' Other

'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'list'"      Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\'item\' => array(\'1\', \'2\', array(\'3.1\', array(\'3.2.1\', \'3.2.2\'), \'3.4\')))\n--EXPECT--\n<ol class="b"><li>"1"</li><li>"2"</li><li><ol class="b"><li>"3.1"</li><li><ol class="b"><li>"3.2.1"</li><li>"3.2.2"</li></ol></li><li>"3.4"</li></ol></li></ol>\n--TEST--\n"source" function\n--TEMPLATE--\nFOO\n' Other

'{{'          Comment.Preproc
' '           Text
'source'      Name.Variable
'('           Operator
'"foo.twig"'  Literal.String.Double
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\nBAR\n--TEMPLATE(foo.twig)--\n' Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'<br />\n--DATA--\nreturn array()\n--EXPECT--\nFOO\n\n' Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'<br />\n\nBAR\n--TEST--\n"template_from_string" function\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'include'     Keyword
' '           Text
'template_from_string' Name.Variable
'('           Operator
'template'    Name.Variable
')'           Operator
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'include'     Keyword
' '           Text
'template_from_string' Name.Variable
'('           Operator
'"Hello {{ name }}"' Literal.String.Double
')'           Operator
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'include'     Keyword
' '           Text
'template_from_string' Name.Variable
'('           Operator
'\'{% extends "parent.twig" %}{% block content %}Hello {{ name }}{% endblock %}\'' Literal.String.Single
')'           Operator
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(parent.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'name\' => \'Fabien\', \'template\' => "Hello ' Other
'{{'          Comment.Preproc
' '           Text
'name'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'")\n--EXPECT--\nHello Fabien\nHello Fabien\nHello Fabien\n--TEST--\nmacro\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'from'        Keyword
' '           Text
'_self'       Name.Variable
' '           Text
'import'      Name.Variable
' '           Text
'test'        Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'macro'       Keyword
' '           Text
'test'        Name.Variable
'('           Operator
'a'           Name.Variable
','           Operator
' '           Text
'b'           Name.Variable
' '           Text
'='           Operator
' '           Text
"'bar'"       Literal.String.Single
')'           Operator
' '           Text
'-'           Text
'%}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'a'           Name.Variable
' '           Text
'}}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'b'           Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
'- '          Text
'endmacro'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'test'        Name.Variable
'('           Operator
"'foo'"       Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'test'        Name.Variable
'('           Operator
"'bar'"       Literal.String.Single
','           Operator
' '           Text
"'foo'"       Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array();\n--EXPECT--\nfoobar\nbarfoo\n--TEST--\nmacro\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'import'      Keyword
' '           Text
'_self'       Name.Variable
' '           Text
'as'          Name.Variable
' '           Text
'macros'      Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'macro'       Keyword
' '           Text
'foo'         Name.Variable
'('           Operator
'data'        Name.Variable
')'           Operator
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
' '           Text
'data'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endmacro'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'macro'       Keyword
' '           Text
'bar'         Name.Variable
'('           Operator
')'           Operator
' '           Text
'%}'          Comment.Preproc
'\n    <br />\n' Other

'{%'          Comment.Preproc
' '           Text
'endmacro'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'macros'      Name.Variable
'.foo'        Name.Variable
'('           Operator
'macros'      Name.Variable
'.bar'        Name.Variable
'('           Operator
')'           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array();\n--EXPECT--\n<br />\n--TEST--\nmacro\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'from'        Keyword
' '           Text
'_self'       Name.Variable
' '           Text
'import'      Name.Variable
' '           Text
'test'        Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'macro'       Keyword
' '           Text
'test'        Name.Variable
'('           Operator
'this'        Name.Variable
')'           Operator
' '           Text
'-'           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
' '           Text
'this'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
'- '          Text
'endmacro'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'test'        Name.Variable
'('           Operator
'this'        Name.Variable
')'           Operator
' '           Text
'}}'          Comment.Preproc
"\n--DATA--\nreturn array('this' => 'foo');\n--EXPECT--\nfoo\n--TEST--\nmacro\n--TEMPLATE--\n" Other

'{%'          Comment.Preproc
' '           Text
'import'      Keyword
' '           Text
'_self'       Name.Variable
' '           Text
'as'          Name.Variable
' '           Text
'test'        Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'from'        Keyword
' '           Text
'_self'       Name.Variable
' '           Text
'import'      Name.Variable
' '           Text
'test'        Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'macro'       Keyword
' '           Text
'test'        Name.Variable
'('           Operator
'a'           Name.Variable
','           Operator
' '           Text
'b'           Name.Variable
')'           Operator
' '           Text
'-'           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
' '           Text
'a'           Name.Variable
'|'           Operator
'default'     Name.Function
'('           Operator
"'a'"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'<br />\n    ' Other
'{{'          Comment.Preproc
'-'           Operator
' '           Text
'b'           Name.Variable
'|'           Operator
'default'     Name.Function
'('           Operator
"'b'"         Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'<br />\n'    Other

'{%'          Comment.Preproc
'- '          Text
'endmacro'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'test'        Name.Variable
'.test'       Name.Variable
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'test'        Name.Variable
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'test'        Name.Variable
'.test'       Name.Variable
'('           Operator
'1'           Literal.Number
','           Operator
' '           Text
'"c"'         Literal.String.Double
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'test'        Name.Variable
'('           Operator
'1'           Literal.Number
','           Operator
' '           Text
'"c"'         Literal.String.Double
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array();\n--EXPECT--\na<br />b<br />\na<br />b<br />\n1<br />c<br />\n1<br />c<br />\n--TEST--\nmacro with a filter\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'import'      Keyword
' '           Text
'_self'       Name.Variable
' '           Text
'as'          Name.Variable
' '           Text
'test'        Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'macro'       Keyword
' '           Text
'test'        Name.Variable
'('           Operator
')'           Operator
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{%'          Comment.Preproc
' '           Text
'filter'      Keyword
' '           Text
'escape'      Name.Function
' '           Text
'%}'          Comment.Preproc
'foo<br />'   Other
'{%'          Comment.Preproc
' '           Text
'endfilter'   Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endmacro'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'test'        Name.Variable
'.test'       Name.Variable
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array();\n--EXPECT--\nfoo&lt;br /&gt;\n--TEST--\nTwig outputs 0 nodes correctly\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'0'           Other
'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
' '           Text
'}}'          Comment.Preproc
"\n--DATA--\nreturn array('foo' => 'foo')\n--EXPECT--\nfoo0foo\n--TEST--\nerror in twig extension\n--TEMPLATE--\n" Other

'{{'          Comment.Preproc
' '           Text
'object'      Name.Variable
'.region'     Name.Variable
' '           Text
'is'          Keyword
' '           Text
'not'         Keyword
' '           Text
'null'        Name.Function
' '           Text
'?'           Operator
' '           Text
'object'      Name.Variable
'.regionChoices' Name.Variable
'['           Operator
'object'      Name.Variable
'.region'     Name.Variable
']'           Operator
' '           Text
'}}'          Comment.Preproc
"\n--EXPECT--\nhouse.region.s\n--TEST--\nTwig is able to deal with SimpleXMLElement instances as variables\n--CONDITION--\nversion_compare(phpversion(), '5.3.0', '>=')\n--TEMPLATE--\nHello '" Other
'{{'          Comment.Preproc
' '           Text
'images'      Name.Variable
'.image'      Name.Variable
'.0'          Literal.Number
'.group'      Name.Variable
' '           Text
'}}'          Comment.Preproc
"'!\n"        Other

'{{'          Comment.Preproc
' '           Text
'images'      Name.Variable
'.image'      Name.Variable
'.0'          Literal.Number
'.group'      Name.Variable
'.attributes' Name.Variable
'.myattr'     Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'images'      Name.Variable
'.children'   Name.Variable
'('           Operator
')'           Operator
'.image'      Name.Variable
'.count'      Name.Variable
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'image'       Name.Variable
' '           Text
'in'          Keyword
' '           Text
'images'      Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    - '    Other
'{{'          Comment.Preproc
' '           Text
'image'       Name.Variable
'.group'      Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'images\' => new SimpleXMLElement(\'<images><image><group myattr="example">foo</group></image><image><group>bar</group></image></images>\'))\n--EXPECT--\nHello \'foo\'!\nexample\n2\n    - foo\n    - bar\n--TEST--\nTwig does not confuse strings with integers in getAttribute()\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'hash'        Name.Variable
'['           Operator
"'2e2'"       Literal.String.Single
']'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\'hash\' => array(\'2e2\' => \'works\'))\n--EXPECT--\nworks\n--TEST--\n"autoescape" tag applies escaping on its children\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'<br />\n'    Other

'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
"'html'"      Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'<br />\n'    Other

'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
'false'       Keyword.Pseudo
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'<br />\n'    Other

'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
'true'        Keyword.Pseudo
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'<br />\n'    Other

'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
'false'       Keyword.Pseudo
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'<br />\n'    Other

'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'var\' => \'<br />\')\n--EXPECT--\n&lt;br /&gt;<br />\n&lt;br /&gt;<br />\n<br /><br />\n&lt;br /&gt;<br />\n<br /><br />\n--TEST--\n"autoescape" tag applies escaping on embedded blocks\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
"'html'"      Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n  '        Other
'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'foo'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n  '        Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'var\' => \'<br />\')\n--EXPECT--\n&lt;br /&gt;\n--TEST--\n"autoescape" tag does not double-escape\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
"'html'"      Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
'|'           Operator
'escape'      Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'var\' => \'<br />\')\n--EXPECT--\n&lt;br /&gt;\n--TEST--\n"autoescape" tag applies escaping after calling functions\n--TEMPLATE--\n\nautoescape false\n' Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
'false'       Keyword.Pseudo
' '           Text
'%}'          Comment.Preproc
'\n\nsafe_br\n' Other

'{{'          Comment.Preproc
' '           Text
'safe_br'     Name.Variable
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\nunsafe_br\n' Other

'{{'          Comment.Preproc
' '           Text
'unsafe_br'   Name.Variable
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
"\n\nautoescape 'html'\n" Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
"'html'"      Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n\nsafe_br\n' Other

'{{'          Comment.Preproc
' '           Text
'safe_br'     Name.Variable
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\nunsafe_br\n' Other

'{{'          Comment.Preproc
' '           Text
'unsafe_br'   Name.Variable
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\nunsafe_br()|raw\n' Other

'{{'          Comment.Preproc
' '           Text
'('           Operator
'unsafe_br'   Name.Variable
'('           Operator
')'           Operator
')'           Operator
'|'           Operator
'raw'         Name.Function
' '           Text
'}}'          Comment.Preproc
'\n\nsafe_br()|escape\n' Other

'{{'          Comment.Preproc
' '           Text
'('           Operator
'safe_br'     Name.Variable
'('           Operator
')'           Operator
')'           Operator
'|'           Operator
'escape'      Name.Function
' '           Text
'}}'          Comment.Preproc
'\n\nsafe_br()|raw\n' Other

'{{'          Comment.Preproc
' '           Text
'('           Operator
'safe_br'     Name.Variable
'('           Operator
')'           Operator
')'           Operator
'|'           Operator
'raw'         Name.Function
' '           Text
'}}'          Comment.Preproc
'\n\nunsafe_br()|escape\n' Other

'{{'          Comment.Preproc
' '           Text
'('           Operator
'unsafe_br'   Name.Variable
'('           Operator
')'           Operator
')'           Operator
'|'           Operator
'escape'      Name.Function
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n\nautoescape js\n' Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
"'js'"        Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n\nsafe_br\n' Other

'{{'          Comment.Preproc
' '           Text
'safe_br'     Name.Variable
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n\nautoescape false\n\nsafe_br\n<br />\n\nunsafe_br\n<br />\n\n\nautoescape \'html\'\n\nsafe_br\n<br />\n\nunsafe_br\n&lt;br /&gt;\n\nunsafe_br()|raw\n<br />\n\nsafe_br()|escape\n&lt;br /&gt;\n\nsafe_br()|raw\n<br />\n\nunsafe_br()|escape\n&lt;br /&gt;\n\n\nautoescape js\n\nsafe_br\n\\x3Cbr\\x20\\x2F\\x3E\n--TEST--\n"autoescape" tag does not apply escaping on literals\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
"'html'"      Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n\n1. Simple literal\n' Other

'{{'          Comment.Preproc
' '           Text
'"<br />"'    Literal.String.Double
' '           Text
'}}'          Comment.Preproc
'\n\n2. Conditional expression with only literals\n' Other

'{{'          Comment.Preproc
' '           Text
'true'        Keyword.Pseudo
' '           Text
'?'           Operator
' '           Text
'"<br />"'    Literal.String.Double
' '           Text
':'           Operator
' '           Text
'"<br>"'      Literal.String.Double
' '           Text
'}}'          Comment.Preproc
'\n\n3. Conditional expression with a variable\n' Other

'{{'          Comment.Preproc
' '           Text
'true'        Keyword.Pseudo
' '           Text
'?'           Operator
' '           Text
'"<br />"'    Literal.String.Double
' '           Text
':'           Operator
' '           Text
'someVar'     Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n\n4. Nested conditionals with only literals\n' Other

'{{'          Comment.Preproc
' '           Text
'true'        Keyword.Pseudo
' '           Text
'?'           Operator
' '           Text
'('           Operator
'true'        Keyword.Pseudo
' '           Text
'?'           Operator
' '           Text
'"<br />"'    Literal.String.Double
' '           Text
':'           Operator
' '           Text
'"<br>"'      Literal.String.Double
')'           Operator
' '           Text
':'           Operator
' '           Text
'"\\n"'       Literal.String.Double
' '           Text
'}}'          Comment.Preproc
'\n\n5. Nested conditionals with a variable\n' Other

'{{'          Comment.Preproc
' '           Text
'true'        Keyword.Pseudo
' '           Text
'?'           Operator
' '           Text
'('           Operator
'true'        Keyword.Pseudo
' '           Text
'?'           Operator
' '           Text
'"<br />"'    Literal.String.Double
' '           Text
':'           Operator
' '           Text
'someVar'     Name.Variable
')'           Operator
' '           Text
':'           Operator
' '           Text
'"\\n"'       Literal.String.Double
' '           Text
'}}'          Comment.Preproc
'\n\n6. Nested conditionals with a variable marked safe\n' Other

'{{'          Comment.Preproc
' '           Text
'true'        Keyword.Pseudo
' '           Text
'?'           Operator
' '           Text
'('           Operator
'true'        Keyword.Pseudo
' '           Text
'?'           Operator
' '           Text
'"<br />"'    Literal.String.Double
' '           Text
':'           Operator
' '           Text
'someVar'     Name.Variable
'|'           Operator
'raw'         Name.Function
')'           Operator
' '           Text
':'           Operator
' '           Text
'"\\n"'       Literal.String.Double
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n\n1. Simple literal\n<br />\n\n2. Conditional expression with only literals\n<br />\n\n3. Conditional expression with a variable\n&lt;br /&gt;\n\n4. Nested conditionals with only literals\n<br />\n\n5. Nested conditionals with a variable\n&lt;br /&gt;\n\n6. Nested conditionals with a variable marked safe\n<br />\n--TEST--\n"autoescape" tags can be nested at will\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
"'html'"      Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n  '        Other
'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n  '        Other
'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
'false'       Keyword.Pseudo
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n    '      Other
'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
"'html'"      Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n      '    Other
'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n    '      Other
'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n  '        Other
'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n  '        Other
'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\'var\' => \'<br />\')\n--EXPECT--\n&lt;br /&gt;\n  &lt;br /&gt;\n      <br />\n          &lt;br /&gt;\n        <br />\n    &lt;br /&gt;\n&lt;br /&gt;\n--TEST--\n"autoescape" tag applies escaping to object method calls\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
"'html'"      Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'user'        Name.Variable
'.name'       Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'user'        Name.Variable
'.name'       Name.Variable
'|'           Operator
'lower'       Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'user'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n--EXPECT--\nFabien&lt;br /&gt;\nfabien&lt;br /&gt;\nFabien&lt;br /&gt;\n--TEST--\n"autoescape" tag does not escape when raw is used as a filter\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
"'html'"      Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
'|'           Operator
'raw'         Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'var\' => \'<br />\')\n--EXPECT--\n<br />\n--TEST--\n"autoescape" tag accepts an escaping strategy\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
'true'        Keyword.Pseudo
' '           Text
'js'          Name.Variable
' '           Text
'%}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
'true'        Keyword.Pseudo
' '           Text
'html'        Name.Variable
' '           Text
'%}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
"'js'"        Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
"'html'"      Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'var\' => \'<br />"\')\n--EXPECT--\n\\x3Cbr\\x20\\x2F\\x3E\\x22\n&lt;br /&gt;&quot;\n\\x3Cbr\\x20\\x2F\\x3E\\x22\n&lt;br /&gt;&quot;\n--TEST--\nescape types\n--TEMPLATE--\n\n1. autoescape \'html\' |escape(\'js\')\n\n' Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
"'html'"      Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n<a onclick="alert(&quot;' Other
'{{'          Comment.Preproc
' '           Text
'msg'         Name.Variable
'|'           Operator
'escape'      Name.Function
'('           Operator
"'js'"        Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'&quot;)"></a>\n' Other

'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
"\n\n2. autoescape 'html' |escape('js')\n\n" Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
"'html'"      Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n<a onclick="alert(&quot;' Other
'{{'          Comment.Preproc
' '           Text
'msg'         Name.Variable
'|'           Operator
'escape'      Name.Function
'('           Operator
"'js'"        Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'&quot;)"></a>\n' Other

'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
"\n\n3. autoescape 'js' |escape('js')\n\n" Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
"'js'"        Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n<a onclick="alert(&quot;' Other
'{{'          Comment.Preproc
' '           Text
'msg'         Name.Variable
'|'           Operator
'escape'      Name.Function
'('           Operator
"'js'"        Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'&quot;)"></a>\n' Other

'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n4. no escape\n\n' Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
'false'       Keyword.Pseudo
' '           Text
'%}'          Comment.Preproc
'\n<a onclick="alert(&quot;' Other
'{{'          Comment.Preproc
' '           Text
'msg'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'&quot;)"></a>\n' Other

'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
"\n\n5. |escape('js')|escape('html')\n\n" Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
'false'       Keyword.Pseudo
' '           Text
'%}'          Comment.Preproc
'\n<a onclick="alert(&quot;' Other
'{{'          Comment.Preproc
' '           Text
'msg'         Name.Variable
'|'           Operator
'escape'      Name.Function
'('           Operator
"'js'"        Literal.String.Single
')'           Operator
'|'           Operator
'escape'      Name.Function
'('           Operator
"'html'"      Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'&quot;)"></a>\n' Other

'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
"\n\n6. autoescape 'html' |escape('js')|escape('html')\n\n" Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
"'html'"      Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n<a onclick="alert(&quot;' Other
'{{'          Comment.Preproc
' '           Text
'msg'         Name.Variable
'|'           Operator
'escape'      Name.Function
'('           Operator
"'js'"        Literal.String.Single
')'           Operator
'|'           Operator
'escape'      Name.Function
'('           Operator
"'html'"      Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'&quot;)"></a>\n' Other

'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n--DATA--\nreturn array(\'msg\' => "<>\\n\'\\"")\n--EXPECT--\n\n1. autoescape \'html\' |escape(\'js\')\n\n<a onclick="alert(&quot;\\x3C\\x3E\\x0A\\x27\\x22&quot;)"></a>\n\n2. autoescape \'html\' |escape(\'js\')\n\n<a onclick="alert(&quot;\\x3C\\x3E\\x0A\\x27\\x22&quot;)"></a>\n\n3. autoescape \'js\' |escape(\'js\')\n\n<a onclick="alert(&quot;\\x3C\\x3E\\x0A\\x27\\x22&quot;)"></a>\n\n4. no escape\n\n<a onclick="alert(&quot;<>\n\'"&quot;)"></a>\n\n5. |escape(\'js\')|escape(\'html\')\n\n<a onclick="alert(&quot;\\x3C\\x3E\\x0A\\x27\\x22&quot;)"></a>\n\n6. autoescape \'html\' |escape(\'js\')|escape(\'html\')\n\n<a onclick="alert(&quot;\\x3C\\x3E\\x0A\\x27\\x22&quot;)"></a>\n\n--TEST--\n"autoescape" tag do not applies escaping on filter arguments\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
"'html'"      Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
'|'           Operator
'nl2br'       Name.Function
'('           Operator
'"<br />"'    Literal.String.Double
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
'|'           Operator
'nl2br'       Name.Function
'('           Operator
'"<br />"'    Literal.String.Double
'|'           Operator
'escape'      Name.Function
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
'|'           Operator
'nl2br'       Name.Function
'('           Operator
'sep'         Name.Variable
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
'|'           Operator
'nl2br'       Name.Function
'('           Operator
'sep'         Name.Variable
'|'           Operator
'raw'         Name.Function
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
'|'           Operator
'nl2br'       Name.Function
'('           Operator
'sep'         Name.Variable
'|'           Operator
'escape'      Name.Function
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'var\' => "<Fabien>\\nTwig", \'sep\' => \'<br />\')\n--EXPECT--\n&lt;Fabien&gt;<br />\nTwig\n&lt;Fabien&gt;&lt;br /&gt;\nTwig\n&lt;Fabien&gt;<br />\nTwig\n&lt;Fabien&gt;<br />\nTwig\n&lt;Fabien&gt;&lt;br /&gt;\nTwig\n--TEST--\n"autoescape" tag applies escaping after calling filters\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
"'html'"      Literal.String.Single
' '           Text
'%}'          Comment.Preproc
"\n\n(escape_and_nl2br is an escaper filter)\n\n1. Don't escape escaper filter output\n( var is escaped by |escape_and_nl2br, line-breaks are added, \n  the output is not escaped )\n" Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
'|'           Operator
'escape_and_nl2br' Name.Function
' '           Text
'}}'          Comment.Preproc
"\n\n2. Don't escape escaper filter output\n( var is escaped by |escape_and_nl2br, line-breaks are added, \n  the output is not escaped, |raw is redundant )\n" Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
'|'           Operator
'escape_and_nl2br' Name.Function
'|'           Operator
'raw'         Name.Function
' '           Text
'}}'          Comment.Preproc
'\n\n3. Explicit escape\n( var is escaped by |escape_and_nl2br, line-breaks are added,\n  the output is explicitly escaped by |escape )\n' Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
'|'           Operator
'escape_and_nl2br' Name.Function
'|'           Operator
'escape'      Name.Function
' '           Text
'}}'          Comment.Preproc
'\n\n4. Escape non-escaper filter output\n( var is upper-cased by |upper,\n  the output is auto-escaped )\n' Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
'|'           Operator
'upper'       Name.Function
' '           Text
'}}'          Comment.Preproc
'\n\n5. Escape if last filter is not an escaper\n( var is escaped by |escape_and_nl2br, line-breaks are added,\n  the output is upper-cased by |upper,\n  the output is auto-escaped as |upper is not an escaper )\n' Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
'|'           Operator
'escape_and_nl2br' Name.Function
'|'           Operator
'upper'       Name.Function
' '           Text
'}}'          Comment.Preproc
"\n\n6. Don't escape escaper filter output\n( var is upper cased by upper,\n  the output is escaped by |escape_and_nl2br, line-breaks are added,\n  the output is not escaped as |escape_and_nl2br is an escaper )\n" Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
'|'           Operator
'upper'       Name.Function
'|'           Operator
'escape_and_nl2br' Name.Function
' '           Text
'}}'          Comment.Preproc
'\n\n7. Escape if last filter is not an escaper\n( the output of |format is "<b>" ~ var ~ "</b>",\n  the output is auto-escaped )\n' Other

'{{'          Comment.Preproc
' '           Text
'"<b>%s</b>"' Literal.String.Double
'|'           Operator
'format'      Name.Function
'('           Operator
'var'         Name.Variable
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\n8. Escape if last filter is not an escaper\n( the output of |format is "<b>" ~ var ~ "</b>",\n  |raw is redundant,\n  the output is auto-escaped )\n' Other

'{{'          Comment.Preproc
' '           Text
'"<b>%s</b>"' Literal.String.Double
'|'           Operator
'raw'         Name.Function
'|'           Operator
'format'      Name.Function
'('           Operator
'var'         Name.Variable
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\n9. Don\'t escape escaper filter output\n( the output of |format is "<b>" ~ var ~ "</b>",\n  the output is not escaped due to |raw filter at the end )\n' Other

'{{'          Comment.Preproc
' '           Text
'"<b>%s</b>"' Literal.String.Double
'|'           Operator
'format'      Name.Function
'('           Operator
'var'         Name.Variable
')'           Operator
'|'           Operator
'raw'         Name.Function
' '           Text
'}}'          Comment.Preproc
'\n\n10. Don\'t escape escaper filter output\n( the output of |format is "<b>" ~ var ~ "</b>",\n  the output is not escaped due to |raw filter at the end,\n  the |raw filter on var is redundant )\n' Other

'{{'          Comment.Preproc
' '           Text
'"<b>%s</b>"' Literal.String.Double
'|'           Operator
'format'      Name.Function
'('           Operator
'var'         Name.Variable
'|'           Operator
'raw'         Name.Function
')'           Operator
'|'           Operator
'raw'         Name.Function
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'var\' => "<Fabien>\\nTwig")\n--EXPECT--\n\n(escape_and_nl2br is an escaper filter)\n\n1. Don\'t escape escaper filter output\n( var is escaped by |escape_and_nl2br, line-breaks are added, \n  the output is not escaped )\n&lt;Fabien&gt;<br />\nTwig\n\n2. Don\'t escape escaper filter output\n( var is escaped by |escape_and_nl2br, line-breaks are added, \n  the output is not escaped, |raw is redundant )\n&lt;Fabien&gt;<br />\nTwig\n\n3. Explicit escape\n( var is escaped by |escape_and_nl2br, line-breaks are added,\n  the output is explicitly escaped by |escape )\n&amp;lt;Fabien&amp;gt;&lt;br /&gt;\nTwig\n\n4. Escape non-escaper filter output\n( var is upper-cased by |upper,\n  the output is auto-escaped )\n&lt;FABIEN&gt;\nTWIG\n\n5. Escape if last filter is not an escaper\n( var is escaped by |escape_and_nl2br, line-breaks are added,\n  the output is upper-cased by |upper,\n  the output is auto-escaped as |upper is not an escaper )\n&amp;LT;FABIEN&amp;GT;&lt;BR /&gt;\nTWIG\n\n6. Don\'t escape escaper filter output\n( var is upper cased by upper,\n  the output is escaped by |escape_and_nl2br, line-breaks are added,\n  the output is not escaped as |escape_and_nl2br is an escaper )\n&lt;FABIEN&gt;<br />\nTWIG\n\n7. Escape if last filter is not an escaper\n( the output of |format is "<b>" ~ var ~ "</b>",\n  the output is auto-escaped )\n&lt;b&gt;&lt;Fabien&gt;\nTwig&lt;/b&gt;\n\n8. Escape if last filter is not an escaper\n( the output of |format is "<b>" ~ var ~ "</b>",\n  |raw is redundant,\n  the output is auto-escaped )\n&lt;b&gt;&lt;Fabien&gt;\nTwig&lt;/b&gt;\n\n9. Don\'t escape escaper filter output\n( the output of |format is "<b>" ~ var ~ "</b>",\n  the output is not escaped due to |raw filter at the end )\n<b><Fabien>\nTwig</b>\n\n10. Don\'t escape escaper filter output\n( the output of |format is "<b>" ~ var ~ "</b>",\n  the output is not escaped due to |raw filter at the end,\n  the |raw filter on var is redundant )\n<b><Fabien>\nTwig</b>\n--TEST--\n"autoescape" tag applies escaping after calling filters, and before calling pre_escape filters\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
"'html'"      Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n\n(nl2br is pre_escaped for "html" and declared safe for "html")\n\n1. Pre-escape and don\'t post-escape\n( var|escape|nl2br )\n' Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
'|'           Operator
'nl2br'       Name.Function
' '           Text
'}}'          Comment.Preproc
"\n\n2. Don't double-pre-escape\n( var|escape|nl2br )\n" Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
'|'           Operator
'escape'      Name.Function
'|'           Operator
'nl2br'       Name.Function
' '           Text
'}}'          Comment.Preproc
"\n\n3. Don't escape safe values\n( var|raw|nl2br )\n" Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
'|'           Operator
'raw'         Name.Function
'|'           Operator
'nl2br'       Name.Function
' '           Text
'}}'          Comment.Preproc
"\n\n4. Don't escape safe values\n( var|escape|nl2br|nl2br )\n" Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
'|'           Operator
'nl2br'       Name.Function
'|'           Operator
'nl2br'       Name.Function
' '           Text
'}}'          Comment.Preproc
'\n\n5. Re-escape values that are escaped for an other contexts\n( var|escape_something|escape|nl2br )\n' Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
'|'           Operator
'escape_something' Name.Function
'|'           Operator
'nl2br'       Name.Function
' '           Text
'}}'          Comment.Preproc
'\n\n6. Still escape when using filters not declared safe\n( var|escape|nl2br|upper|escape )\n' Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
'|'           Operator
'nl2br'       Name.Function
'|'           Operator
'upper'       Name.Function
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'var\' => "<Fabien>\\nTwig")\n--EXPECT--\n\n(nl2br is pre_escaped for "html" and declared safe for "html")\n\n1. Pre-escape and don\'t post-escape\n( var|escape|nl2br )\n&lt;Fabien&gt;<br />\nTwig\n\n2. Don\'t double-pre-escape\n( var|escape|nl2br )\n&lt;Fabien&gt;<br />\nTwig\n\n3. Don\'t escape safe values\n( var|raw|nl2br )\n<Fabien><br />\nTwig\n\n4. Don\'t escape safe values\n( var|escape|nl2br|nl2br )\n&lt;Fabien&gt;<br /><br />\nTwig\n\n5. Re-escape values that are escaped for an other contexts\n( var|escape_something|escape|nl2br )\n&lt;FABIEN&gt;<br />\nTWIG\n\n6. Still escape when using filters not declared safe\n( var|escape|nl2br|upper|escape )\n&amp;LT;FABIEN&amp;GT;&lt;BR /&gt;\nTWIG\n\n--TEST--\n"autoescape" tag handles filters preserving the safety\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'autoescape'  Keyword
' '           Text
"'html'"      Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n\n(preserves_safety is preserving safety for "html")\n\n1. Unsafe values are still unsafe\n( var|preserves_safety|escape )\n' Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
'|'           Operator
'preserves_safety' Name.Function
' '           Text
'}}'          Comment.Preproc
'\n\n2. Safe values are still safe\n( var|escape|preserves_safety )\n' Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
'|'           Operator
'escape'      Name.Function
'|'           Operator
'preserves_safety' Name.Function
' '           Text
'}}'          Comment.Preproc
'\n\n3. Re-escape values that are escaped for an other contexts\n( var|escape_something|preserves_safety|escape )\n' Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
'|'           Operator
'escape_something' Name.Function
'|'           Operator
'preserves_safety' Name.Function
' '           Text
'}}'          Comment.Preproc
'\n\n4. Still escape when using filters not declared safe\n( var|escape|preserves_safety|replace(' Other
'{'           Other
"'FABIEN': 'FABPOT'})|escape )\n" Other

'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
'|'           Operator
'escape'      Name.Function
'|'           Operator
'preserves_safety' Name.Function
'|'           Operator
'replace'     Name.Function
'('           Operator
'{'           Operator
"'FABIEN'"    Literal.String.Single
':'           Operator
' '           Text
"'FABPOT'"    Literal.String.Single
'}'           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'endautoescape' Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'var\' => "<Fabien>\\nTwig")\n--EXPECT--\n\n(preserves_safety is preserving safety for "html")\n\n1. Unsafe values are still unsafe\n( var|preserves_safety|escape )\n&lt;FABIEN&gt;\nTWIG\n\n2. Safe values are still safe\n( var|escape|preserves_safety )\n&LT;FABIEN&GT;\nTWIG\n\n3. Re-escape values that are escaped for an other contexts\n( var|escape_something|preserves_safety|escape )\n&lt;FABIEN&gt;\nTWIG\n\n4. Still escape when using filters not declared safe\n( var|escape|preserves_safety|replace(' Other
'{'           Other
'\'FABIEN\': \'FABPOT\'})|escape )\n&amp;LT;FABPOT&amp;GT;\nTWIG\n\n--TEST--\n"block" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'title1'      Name.Variable
' '           Text
'%}'          Comment.Preproc
'FOO'         Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'title2'      Name.Variable
' '           Text
'foo'         Name.Variable
'|'           Operator
'lower'       Name.Function
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'foo\' => \'bar\')\n--EXPECT--\nFOObar\n--TEST--\n"block" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXCEPTION--\nTwig_Error_Syntax: The block \'content\' has already been defined line 2 in "index.twig" at line 3\n--TEST--\n"§" special chars in a block name\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'§'           Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n§\n'       Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'§'           Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n§\n--TEST--\n"embed" tag\n--TEMPLATE--\nFOO\n' Other

'{%'          Comment.Preproc
' '           Text
'embed'       Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'c1'          Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n        '  Other
'{{'          Comment.Preproc
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n        block1extended\n    ' Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endembed'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n\nBAR\n--TEMPLATE(foo.twig)--\nA\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'c1'          Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    block1\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\nB\n'       Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'c2'          Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    block2\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\nC\n--DATA--\nreturn array()\n--EXPECT--\nFOO\n\nA\n            block1\n\n        block1extended\n    B\n    block2\nC\nBAR\n--TEST--\n"embed" tag\n--TEMPLATE(index.twig)--\nFOO\n' Other

'{%'          Comment.Preproc
' '           Text
'embed'       Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'c1'          Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n        '  Other
'{{'          Comment.Preproc
' '           Text
'nothing'     Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n    '      Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endembed'    Keyword
' '           Text
'%}'          Comment.Preproc
'\nBAR\n--TEMPLATE(foo.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'c1'          Name.Variable
' '           Text
'%}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXCEPTION--\nTwig_Error_Runtime: Variable "nothing" does not exist in "index.twig" at line 5\n--TEST--\n"embed" tag\n--TEMPLATE--\nFOO\n' Other

'{%'          Comment.Preproc
' '           Text
'embed'       Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'c1'          Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n        '  Other
'{{'          Comment.Preproc
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n        block1extended\n    ' Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endembed'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'embed'       Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'c1'          Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n        '  Other
'{{'          Comment.Preproc
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n        block1extended\n    ' Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endembed'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n\nBAR\n--TEMPLATE(foo.twig)--\nA\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'c1'          Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    block1\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\nB\n'       Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'c2'          Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    block2\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\nC\n--DATA--\nreturn array()\n--EXPECT--\nFOO\n\nA\n            block1\n\n        block1extended\n    B\n    block2\nC\n\nA\n            block1\n\n        block1extended\n    B\n    block2\nC\nBAR\n--TEST--\n"embed" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'embed'       Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'c1'          Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n        '  Other
'{{'          Comment.Preproc
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n        '  Other
'{%'          Comment.Preproc
' '           Text
'embed'       Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n            ' Other
'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'c1'          Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n                ' Other
'{{'          Comment.Preproc
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n                block1extended\n            ' Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n        '  Other
'{%'          Comment.Preproc
' '           Text
'endembed'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n    '    Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endembed'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\nA\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'c1'          Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    block1\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\nB\n'       Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'c2'          Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    block2\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\nC\n--DATA--\nreturn array()\n--EXPECT--\nA\n            block1\n\n        \nA\n                    block1\n\n                block1extended\n            B\n    block2\nC\n    B\n    block2\nC\n--TEST--\n"embed" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'"base.twig"' Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'c1'          Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n    blockc1baseextended\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'c2'          Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\n    '    Other
'{%'          Comment.Preproc
' '           Text
'embed'       Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n        '  Other
'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'c1'          Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n            ' Other
'{{'          Comment.Preproc
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n            block1extended\n        ' Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{%'          Comment.Preproc
' '           Text
'endembed'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(base.twig)--\nA\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'c1'          Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    blockc1base\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'c2'          Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    blockc2base\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\nB\n--TEMPLATE(foo.twig)--\nA\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'c1'          Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    block1\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\nB\n'       Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'c2'          Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    block2\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\nC\n--DATA--\nreturn array()\n--EXPECT--\nA\n        blockc1base\n\n    blockc1baseextended\n        blockc2base\n\n\n    \nA\n                block1\n\n            block1extended\n        B\n    block2\nCB--TEST--\n"filter" tag applies a filter on its children\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'filter'      Keyword
' '           Text
'upper'       Name.Function
' '           Text
'%}'          Comment.Preproc
'\nSome text with a ' Other
'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endfilter'   Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'var\' => \'var\')\n--EXPECT--\nSOME TEXT WITH A VAR\n--TEST--\n"filter" tag applies a filter on its children\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'filter'      Keyword
' '           Text
'json_encode' Name.Function
'|'           Operator
'raw'         Name.Function
' '           Text
'%}'          Comment.Preproc
'test'        Other
'{%'          Comment.Preproc
' '           Text
'endfilter'   Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n"test"\n--TEST--\n"filter" tags accept multiple chained filters\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'filter'      Keyword
' '           Text
'lower'       Name.Function
'|'           Operator
'title'       Name.Function
' '           Text
'%}'          Comment.Preproc
'\n  '        Other
'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endfilter'   Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'var\' => \'VAR\')\n--EXPECT--\n    Var\n--TEST--\n"filter" tags can be nested at will\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'filter'      Keyword
' '           Text
'lower'       Name.Function
'|'           Operator
'title'       Name.Function
' '           Text
'%}'          Comment.Preproc
'\n  '        Other
'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n  '        Other
'{%'          Comment.Preproc
' '           Text
'filter'      Keyword
' '           Text
'upper'       Name.Function
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n  '        Other
'{%'          Comment.Preproc
' '           Text
'endfilter'   Keyword
' '           Text
'%}'          Comment.Preproc
'\n  '        Other
'{{'          Comment.Preproc
' '           Text
'var'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endfilter'   Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'var\' => \'var\')\n--EXPECT--\n  Var\n      Var\n    Var\n--TEST--\n"filter" tag applies the filter on "for" tags\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'filter'      Keyword
' '           Text
'upper'       Name.Function
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'item'        Name.Variable
' '           Text
'in'          Keyword
' '           Text
'items'       Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'item'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endfilter'   Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'items\' => array(\'a\', \'b\'))\n--EXPECT--\nA\nB\n--TEST--\n"filter" tag applies the filter on "if" tags\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'filter'      Keyword
' '           Text
'upper'       Name.Function
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'if'          Keyword
' '           Text
'items'       Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'items'       Name.Variable
'|'           Operator
'join'        Name.Function
'('           Operator
"', '"        Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endif'       Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'if'          Keyword
' '           Text
'items'       Name.Variable
'.3'          Literal.Number
' '           Text
'is'          Keyword
' '           Text
'defined'     Name.Function
' '           Text
'%}'          Comment.Preproc
'\nFOO\n'     Other

'{%'          Comment.Preproc
' '           Text
'else'        Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'items'       Name.Variable
'.1'          Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endif'       Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'if'          Keyword
' '           Text
'items'       Name.Variable
'.3'          Literal.Number
' '           Text
'is'          Keyword
' '           Text
'defined'     Name.Function
' '           Text
'%}'          Comment.Preproc
'\nFOO\n'     Other

'{%'          Comment.Preproc
' '           Text
'elseif'      Keyword
' '           Text
'items'       Name.Variable
'.1'          Literal.Number
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'items'       Name.Variable
'.0'          Literal.Number
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endif'       Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'endfilter'   Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'items\' => array(\'a\', \'b\'))\n--EXPECT--\nA, B\n\nB\n\nA\n--TEST--\n"for" tag takes a condition\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'i'           Name.Variable
' '           Text
'in'          Keyword
' '           Text
'1.'          Literal.Number
'.5'          Literal.Number
' '           Text
'if'          Name.Variable
' '           Text
'i'           Name.Variable
' '           Text
'is'          Keyword
' '           Text
'odd'         Name.Function
' '           Text
'-'           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
' '           Text
'loop'        Name.Builtin
'.index'      Name.Variable
' '           Text
'}}'          Comment.Preproc
'.'           Other
'{{'          Comment.Preproc
' '           Text
'i'           Name.Variable
' '           Text
'}}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
'.bar'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'foo\' => array(\'bar\' => \'X\'))\n--CONFIG--\nreturn array(\'strict_variables\' => false)\n--EXPECT--\n1.1X\n2.3X\n3.5X\n--TEST--\n"for" tag keeps the context safe\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'item'        Name.Variable
' '           Text
'in'          Keyword
' '           Text
'items'       Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n  '        Other
'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'item'        Name.Variable
' '           Text
'in'          Keyword
' '           Text
'items'       Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    * '    Other
'{{'          Comment.Preproc
' '           Text
'item'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n  '        Other
'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n  * '      Other
'{{'          Comment.Preproc
' '           Text
'item'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'items\' => array(\'a\', \'b\'))\n--EXPECT--\n      * a\n      * b\n    * a\n      * a\n      * b\n    * b\n--TEST--\n"for" tag can use an "else" clause\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'item'        Name.Variable
' '           Text
'in'          Keyword
' '           Text
'items'       Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n  * '      Other
'{{'          Comment.Preproc
' '           Text
'item'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'else'        Keyword
' '           Text
'%}'          Comment.Preproc
'\n  no item\n' Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'items\' => array(\'a\', \'b\'))\n--EXPECT--\n  * a\n  * b\n--DATA--\nreturn array(\'items\' => array())\n--EXPECT--\n  no item\n--DATA--\nreturn array()\n--CONFIG--\nreturn array(\'strict_variables\' => false)\n--EXPECT--\n  no item\n--TEST--\n"for" tag does not reset inner variables\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'i'           Name.Variable
' '           Text
'in'          Keyword
' '           Text
'1.'          Literal.Number
'.2'          Literal.Number
' '           Text
'%}'          Comment.Preproc
'\n  '        Other
'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'j'           Name.Variable
' '           Text
'in'          Keyword
' '           Text
'0.'          Literal.Number
'.2'          Literal.Number
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
'k'           Name.Variable
'}}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'set'         Keyword
' '           Text
'k'           Name.Variable
' '           Text
'='           Operator
' '           Text
'k'           Name.Variable
'+'           Operator
'1'           Literal.Number
' '           Text
'%}'          Comment.Preproc
' '           Other
'{{'          Comment.Preproc
' '           Text
'loop'        Name.Builtin
'.parent'     Name.Variable
'.loop'       Name.Variable
'.index'      Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n  '        Other
'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'k\' => 0)\n--EXPECT--\n      0 1\n      1 1\n      2 1\n        3 2\n      4 2\n      5 2\n--TEST--\n"for" tag can iterate over keys and values\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'key'         Name.Variable
','           Operator
' '           Text
'item'        Name.Variable
' '           Text
'in'          Keyword
' '           Text
'items'       Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n  * '      Other
'{{'          Comment.Preproc
' '           Text
'key'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'/'           Other
'{{'          Comment.Preproc
' '           Text
'item'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'items\' => array(\'a\', \'b\'))\n--EXPECT--\n  * 0/a\n  * 1/b\n--TEST--\n"for" tag can iterate over keys\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'key'         Name.Variable
' '           Text
'in'          Keyword
' '           Text
'items'       Name.Variable
'|'           Operator
'keys'        Name.Function
' '           Text
'%}'          Comment.Preproc
'\n  * '      Other
'{{'          Comment.Preproc
' '           Text
'key'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'items\' => array(\'a\', \'b\'))\n--EXPECT--\n  * 0\n  * 1\n--TEST--\n"for" tag adds a loop variable to the context locally\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'item'        Name.Variable
' '           Text
'in'          Keyword
' '           Text
'items'       Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'if'          Keyword
' '           Text
'loop'        Name.Builtin
' '           Text
'is'          Keyword
' '           Text
'not'         Keyword
' '           Text
'defined'     Name.Function
' '           Text
'%}'          Comment.Preproc
'WORKS'       Other
'{%'          Comment.Preproc
' '           Text
'endif'       Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'items\' => array())\n--EXPECT--\nWORKS\n--TEST--\n"for" tag adds a loop variable to the context\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'item'        Name.Variable
' '           Text
'in'          Keyword
' '           Text
'items'       Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n  * '      Other
'{{'          Comment.Preproc
' '           Text
'loop'        Name.Builtin
'.index'      Name.Variable
' '           Text
'}}'          Comment.Preproc
'/'           Other
'{{'          Comment.Preproc
' '           Text
'loop'        Name.Builtin
'.index0'     Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n  * '      Other
'{{'          Comment.Preproc
' '           Text
'loop'        Name.Builtin
'.revindex'   Name.Variable
' '           Text
'}}'          Comment.Preproc
'/'           Other
'{{'          Comment.Preproc
' '           Text
'loop'        Name.Builtin
'.revindex0'  Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n  * '      Other
'{{'          Comment.Preproc
' '           Text
'loop'        Name.Builtin
'.first'      Name.Variable
' '           Text
'}}'          Comment.Preproc
'/'           Other
'{{'          Comment.Preproc
' '           Text
'loop'        Name.Builtin
'.last'       Name.Variable
' '           Text
'}}'          Comment.Preproc
'/'           Other
'{{'          Comment.Preproc
' '           Text
'loop'        Name.Builtin
'.length'     Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'items\' => array(\'a\', \'b\'))\n--EXPECT--\n  * 1/0\n  * 2/1\n  * 1//2\n\n  * 2/1\n  * 1/0\n  * /1/2\n--TEST--\n"for" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'i'           Name.Variable
','           Operator
' '           Text
'item'        Name.Variable
' '           Text
'in'          Keyword
' '           Text
'items'       Name.Variable
' '           Text
'if'          Name.Variable
' '           Text
'loop'        Name.Builtin
'.last'       Name.Variable
' '           Text
'>'           Operator
' '           Text
'0'           Literal.Number
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'items\' => array(\'a\', \'b\'))\n--EXCEPTION--\nTwig_Error_Syntax: The "loop" variable cannot be used in a looping condition in "index.twig" at line 2\n--TEST--\n"for" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'i'           Name.Variable
','           Operator
' '           Text
'item'        Name.Variable
' '           Text
'in'          Keyword
' '           Text
'items'       Name.Variable
' '           Text
'if'          Name.Variable
' '           Text
'i'           Name.Variable
' '           Text
'>'           Operator
' '           Text
'0'           Literal.Number
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
' '           Text
'loop'        Name.Builtin
'.last'       Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'items\' => array(\'a\', \'b\'))\n--EXCEPTION--\nTwig_Error_Syntax: The "loop.last" variable is not defined when looping with a condition in "index.twig" at line 3\n--TEST--\n"for" tag can use an "else" clause\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'item'        Name.Variable
' '           Text
'in'          Keyword
' '           Text
'items'       Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n  '        Other
'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'item'        Name.Variable
' '           Text
'in'          Keyword
' '           Text
'items1'      Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    * '    Other
'{{'          Comment.Preproc
' '           Text
'item'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n  '        Other
'{%'          Comment.Preproc
' '           Text
'else'        Keyword
' '           Text
'%}'          Comment.Preproc
'\n    no '   Other
'{{'          Comment.Preproc
' '           Text
'item'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n  '        Other
'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'else'        Keyword
' '           Text
'%}'          Comment.Preproc
'\n  no item1\n' Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'items\' => array(\'a\', \'b\'), \'items1\' => array())\n--EXPECT--\nno a\n        no b\n--TEST--\n"for" tag iterates over iterable and countable objects\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'item'        Name.Variable
' '           Text
'in'          Keyword
' '           Text
'items'       Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n  * '      Other
'{{'          Comment.Preproc
' '           Text
'item'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n  * '      Other
'{{'          Comment.Preproc
' '           Text
'loop'        Name.Builtin
'.index'      Name.Variable
' '           Text
'}}'          Comment.Preproc
'/'           Other
'{{'          Comment.Preproc
' '           Text
'loop'        Name.Builtin
'.index0'     Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n  * '      Other
'{{'          Comment.Preproc
' '           Text
'loop'        Name.Builtin
'.revindex'   Name.Variable
' '           Text
'}}'          Comment.Preproc
'/'           Other
'{{'          Comment.Preproc
' '           Text
'loop'        Name.Builtin
'.revindex0'  Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n  * '      Other
'{{'          Comment.Preproc
' '           Text
'loop'        Name.Builtin
'.first'      Name.Variable
' '           Text
'}}'          Comment.Preproc
'/'           Other
'{{'          Comment.Preproc
' '           Text
'loop'        Name.Builtin
'.last'       Name.Variable
' '           Text
'}}'          Comment.Preproc
'/'           Other
'{{'          Comment.Preproc
' '           Text
'loop'        Name.Builtin
'.length'     Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'key'         Name.Variable
','           Operator
' '           Text
'value'       Name.Variable
' '           Text
'in'          Keyword
' '           Text
'items'       Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n  * '      Other
'{{'          Comment.Preproc
' '           Text
'key'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'/'           Other
'{{'          Comment.Preproc
' '           Text
'value'       Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'key'         Name.Variable
' '           Text
'in'          Keyword
' '           Text
'items'       Name.Variable
'|'           Operator
'keys'        Name.Function
' '           Text
'%}'          Comment.Preproc
'\n  * '      Other
'{{'          Comment.Preproc
' '           Text
'key'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nclass ItemsIteratorCountable implements Iterator, Countable\n' Other

'{'           Other
"\n  protected $values = array('foo' => 'bar', 'bar' => 'foo');\n  public function current() " Other
'{'           Other
' return current($this->values); }\n  public function key() ' Other
'{'           Other
' return key($this->values); }\n  public function next() ' Other
'{'           Other
' return next($this->values); }\n  public function rewind() ' Other
'{'           Other
' return reset($this->values); }\n  public function valid() ' Other
'{'           Other
' return false !== current($this->values); }\n  public function count() ' Other
'{'           Other
' return count($this->values); }\n}\nreturn array(\'items\' => new ItemsIteratorCountable())\n--EXPECT--\n  * bar\n  * 1/0\n  * 2/1\n  * 1//2\n\n  * foo\n  * 2/1\n  * 1/0\n  * /1/2\n\n\n  * foo/bar\n  * bar/foo\n\n  * foo\n  * bar\n--TEST--\n"for" tag iterates over iterable objects\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'item'        Name.Variable
' '           Text
'in'          Keyword
' '           Text
'items'       Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n  * '      Other
'{{'          Comment.Preproc
' '           Text
'item'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n  * '      Other
'{{'          Comment.Preproc
' '           Text
'loop'        Name.Builtin
'.index'      Name.Variable
' '           Text
'}}'          Comment.Preproc
'/'           Other
'{{'          Comment.Preproc
' '           Text
'loop'        Name.Builtin
'.index0'     Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n  * '      Other
'{{'          Comment.Preproc
' '           Text
'loop'        Name.Builtin
'.first'      Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'key'         Name.Variable
','           Operator
' '           Text
'value'       Name.Variable
' '           Text
'in'          Keyword
' '           Text
'items'       Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n  * '      Other
'{{'          Comment.Preproc
' '           Text
'key'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'/'           Other
'{{'          Comment.Preproc
' '           Text
'value'       Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'key'         Name.Variable
' '           Text
'in'          Keyword
' '           Text
'items'       Name.Variable
'|'           Operator
'keys'        Name.Function
' '           Text
'%}'          Comment.Preproc
'\n  * '      Other
'{{'          Comment.Preproc
' '           Text
'key'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nclass ItemsIterator implements Iterator\n' Other

'{'           Other
"\n  protected $values = array('foo' => 'bar', 'bar' => 'foo');\n  public function current() " Other
'{'           Other
' return current($this->values); }\n  public function key() ' Other
'{'           Other
' return key($this->values); }\n  public function next() ' Other
'{'           Other
' return next($this->values); }\n  public function rewind() ' Other
'{'           Other
' return reset($this->values); }\n  public function valid() ' Other
'{'           Other
' return false !== current($this->values); }\n}\nreturn array(\'items\' => new ItemsIterator())\n--EXPECT--\n  * bar\n  * 1/0\n  * 1\n\n  * foo\n  * 2/1\n  * \n\n\n  * foo/bar\n  * bar/foo\n\n  * foo\n  * bar\n--TEST--\n"for" tags can be nested\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'key'         Name.Variable
','           Operator
' '           Text
'item'        Name.Variable
' '           Text
'in'          Keyword
' '           Text
'items'       Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n* '        Other
'{{'          Comment.Preproc
' '           Text
'key'         Name.Variable
' '           Text
'}}'          Comment.Preproc
' ('          Other
'{{'          Comment.Preproc
' '           Text
'loop'        Name.Builtin
'.length'     Name.Variable
' '           Text
'}}'          Comment.Preproc
'):\n'        Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'value'       Name.Variable
' '           Text
'in'          Keyword
' '           Text
'item'        Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n  * '      Other
'{{'          Comment.Preproc
' '           Text
'value'       Name.Variable
' '           Text
'}}'          Comment.Preproc
' ('          Other
'{{'          Comment.Preproc
' '           Text
'loop'        Name.Builtin
'.length'     Name.Variable
' '           Text
'}}'          Comment.Preproc
')\n'         Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'items\' => array(\'a\' => array(\'a1\', \'a2\', \'a3\'), \'b\' => array(\'b1\')))\n--EXPECT--\n* a (2):\n  * a1 (3)\n  * a2 (3)\n  * a3 (3)\n* b (2):\n  * b1 (1)\n--TEST--\n"for" tag iterates over item values\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'item'        Name.Variable
' '           Text
'in'          Keyword
' '           Text
'items'       Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n  * '      Other
'{{'          Comment.Preproc
' '           Text
'item'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
"\n--DATA--\nreturn array('items' => array('a', 'b'))\n--EXPECT--\n  * a\n  * b\n--TEST--\nglobal variables\n--TEMPLATE--\n" Other

'{%'          Comment.Preproc
' '           Text
'include'     Keyword
' '           Text
'"included.twig"' Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'from'        Keyword
' '           Text
'"included.twig"' Literal.String.Double
' '           Text
'import'      Name.Variable
' '           Text
'foobar'      Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'foobar'      Name.Variable
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--TEMPLATE(included.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'macro'       Keyword
' '           Text
'foobar'      Name.Variable
'('           Operator
')'           Operator
' '           Text
'%}'          Comment.Preproc
'\ncalled foobar\n' Other

'{%'          Comment.Preproc
' '           Text
'endmacro'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array();\n--EXPECT--\ncalled foobar\n--TEST--\n"if" creates a condition\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'if'          Keyword
' '           Text
'a'           Name.Variable
' '           Text
'is'          Keyword
' '           Text
'defined'     Name.Function
' '           Text
'%}'          Comment.Preproc
'\n  '        Other
'{{'          Comment.Preproc
' '           Text
'a'           Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'elseif'      Keyword
' '           Text
'b'           Name.Variable
' '           Text
'is'          Keyword
' '           Text
'defined'     Name.Function
' '           Text
'%}'          Comment.Preproc
'\n  '        Other
'{{'          Comment.Preproc
' '           Text
'b'           Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'else'        Keyword
' '           Text
'%}'          Comment.Preproc
'\n  NOTHING\n' Other

'{%'          Comment.Preproc
' '           Text
'endif'       Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'a\' => \'a\')\n--EXPECT--\n  a\n--DATA--\nreturn array(\'b\' => \'b\')\n--EXPECT--\n  b\n--DATA--\nreturn array()\n--EXPECT--\n  NOTHING\n--TEST--\n"if" takes an expression as a test\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'if'          Keyword
' '           Text
'a'           Name.Variable
' '           Text
'<'           Operator
' '           Text
'2'           Literal.Number
' '           Text
'%}'          Comment.Preproc
'\n  A1\n'    Other

'{%'          Comment.Preproc
' '           Text
'elseif'      Keyword
' '           Text
'a'           Name.Variable
' '           Text
'>'           Operator
' '           Text
'1'           Literal.Number
'0'           Literal.Number
' '           Text
'%}'          Comment.Preproc
'\n  A2\n'    Other

'{%'          Comment.Preproc
' '           Text
'else'        Keyword
' '           Text
'%}'          Comment.Preproc
'\n  A3\n'    Other

'{%'          Comment.Preproc
' '           Text
'endif'       Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'a\' => 1)\n--EXPECT--\n  A1\n--DATA--\nreturn array(\'a\' => 12)\n--EXPECT--\n  A2\n--DATA--\nreturn array(\'a\' => 7)\n--EXPECT--\n  A3\n--TEST--\n"include" tag\n--TEMPLATE--\nFOO\n' Other

'{%'          Comment.Preproc
' '           Text
'include'     Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n\nBAR\n--TEMPLATE(foo.twig)--\nFOOBAR\n--DATA--\nreturn array()\n--EXPECT--\nFOO\n\nFOOBAR\nBAR\n--TEST--\n"include" tag allows expressions for the template to include\n--TEMPLATE--\nFOO\n' Other

'{%'          Comment.Preproc
' '           Text
'include'     Keyword
' '           Text
'foo'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n\nBAR\n--TEMPLATE(foo.twig)--\nFOOBAR\n--DATA--\nreturn array(\'foo\' => \'foo.twig\')\n--EXPECT--\nFOO\n\nFOOBAR\nBAR\n--TEST--\n"include" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'include'     Keyword
' '           Text
'['           Operator
'"foo.twig"'  Literal.String.Double
','           Operator
' '           Text
'"bar.twig"'  Literal.String.Double
']'           Operator
' '           Text
'ignore'      Name.Variable
' '           Text
'missing'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'include'     Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'ignore'      Name.Variable
' '           Text
'missing'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'include'     Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'ignore'      Name.Variable
' '           Text
'missing'     Name.Variable
' '           Text
'with'        Name.Variable
' '           Text
'{'           Operator
'}'           Operator
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'include'     Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'ignore'      Name.Variable
' '           Text
'missing'     Name.Variable
' '           Text
'with'        Name.Variable
' '           Text
'{'           Operator
'}'           Operator
' '           Text
'only'        Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n--TEST--\n"include" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'"base.twig"' Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(base.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{%'          Comment.Preproc
' '           Text
'include'     Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array();\n--EXCEPTION--\nTwig_Error_Loader: Template "foo.twig" is not defined in "base.twig" at line 3.\n--TEST--\n"include" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'include'     Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array();\n--EXCEPTION--\nTwig_Error_Loader: Template "foo.twig" is not defined in "index.twig" at line 2.\n--TEST--\n"include" tag accept variables and only\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'include'     Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'include'     Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'only'        Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'include'     Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'with'        Name.Variable
' '           Text
'{'           Operator
"'foo1'"      Literal.String.Single
':'           Operator
' '           Text
"'bar'"       Literal.String.Single
'}'           Operator
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'include'     Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'with'        Name.Variable
' '           Text
'{'           Operator
"'foo1'"      Literal.String.Single
':'           Operator
' '           Text
"'bar'"       Literal.String.Single
'}'           Operator
' '           Text
'only'        Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'k'           Name.Variable
','           Operator
' '           Text
'v'           Name.Variable
' '           Text
'in'          Keyword
' '           Text
'_context'    Name.Variable
' '           Text
'%}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'k'           Name.Variable
' '           Text
'}}'          Comment.Preproc
','           Other
'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'foo\' => \'bar\')\n--EXPECT--\nfoo,global,_parent,\nglobal,_parent,\nfoo,global,foo1,_parent,\nfoo1,global,_parent,\n--TEST--\n"include" tag accepts Twig_Template instance\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'include'     Keyword
' '           Text
'foo'         Name.Variable
' '           Text
'%}'          Comment.Preproc
' FOO\n--TEMPLATE(foo.twig)--\nBAR\n--DATA--\nreturn array(\'foo\' => $twig->loadTemplate(\'foo.twig\'))\n--EXPECT--\nBAR FOO\n--TEST--\n"include" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'include'     Keyword
' '           Text
'['           Operator
'"foo.twig"'  Literal.String.Double
','           Operator
' '           Text
'"bar.twig"'  Literal.String.Double
']'           Operator
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'include'     Keyword
' '           Text
'['           Operator
'"bar.twig"'  Literal.String.Double
','           Operator
' '           Text
'"foo.twig"'  Literal.String.Double
']'           Operator
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\nfoo\n--DATA--\nreturn array()\n--EXPECT--\nfoo\nfoo\n--TEST--\n"include" tag accept variables\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'include'     Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'with'        Name.Variable
' '           Text
'{'           Operator
"'foo'"       Literal.String.Single
':'           Operator
' '           Text
"'bar'"       Literal.String.Single
'}'           Operator
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'include'     Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'with'        Name.Variable
' '           Text
'vars'        Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\n' Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\'vars\' => array(\'foo\' => \'bar\'))\n--EXPECT--\nbar\nbar\n--TEST--\n"extends" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'\nFOO\n'     Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nFOO\n--TEST--\nblock_expr2\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'"base2.twig"' Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'element'     Name.Variable
' '           Text
'-'           Text
'%}'          Comment.Preproc
'\n    Element:\n    ' Other
'{{'          Comment.Preproc
'-'           Operator
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'-'           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(base2.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'"base.twig"' Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(base.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'spaceless'   Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'element'     Name.Variable
' '           Text
'-'           Text
'%}'          Comment.Preproc
'\n    <div>\n        ' Other
'{%'          Comment.Preproc
'- '          Text
'if'          Keyword
' '           Text
'item'        Name.Variable
'.children'   Name.Variable
' '           Text
'is'          Keyword
' '           Text
'defined'     Name.Function
' '           Text
'%}'          Comment.Preproc
'\n            ' Other
'{%'          Comment.Preproc
'- '          Text
'for'         Keyword
' '           Text
'item'        Name.Variable
' '           Text
'in'          Keyword
' '           Text
'item'        Name.Variable
'.children'   Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n                ' Other
'{{'          Comment.Preproc
'-'           Operator
' '           Text
'block'       Name.Builtin
'('           Operator
"'element'"   Literal.String.Single
')'           Operator
' '           Text
'-'           Text
'}}'          Comment.Preproc
'\n            ' Other
'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n        '  Other
'{%'          Comment.Preproc
'- '          Text
'endif'       Keyword
' '           Text
'-'           Text
'%}'          Comment.Preproc
'\n    </div>\n' Other

'{%'          Comment.Preproc
'- '          Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endspaceless' Keyword
' '           Text
'%}'          Comment.Preproc
"\n--DATA--\nreturn array(\n    'item' => array(\n        'children' => array(\n            null,\n            null,\n        )\n    )\n)\n--EXPECT--\nElement:<div>Element:<div></div>Element:<div></div></div>\n--TEST--\nblock_expr\n--TEMPLATE--\n" Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'"base.twig"' Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'element'     Name.Variable
' '           Text
'-'           Text
'%}'          Comment.Preproc
'\n    Element:\n    ' Other
'{{'          Comment.Preproc
'-'           Operator
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'-'           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(base.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'spaceless'   Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'element'     Name.Variable
' '           Text
'-'           Text
'%}'          Comment.Preproc
'\n    <div>\n        ' Other
'{%'          Comment.Preproc
'- '          Text
'if'          Keyword
' '           Text
'item'        Name.Variable
'.children'   Name.Variable
' '           Text
'is'          Keyword
' '           Text
'defined'     Name.Function
' '           Text
'%}'          Comment.Preproc
'\n            ' Other
'{%'          Comment.Preproc
'- '          Text
'for'         Keyword
' '           Text
'item'        Name.Variable
' '           Text
'in'          Keyword
' '           Text
'item'        Name.Variable
'.children'   Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n                ' Other
'{{'          Comment.Preproc
'-'           Operator
' '           Text
'block'       Name.Builtin
'('           Operator
"'element'"   Literal.String.Single
')'           Operator
' '           Text
'-'           Text
'}}'          Comment.Preproc
'\n            ' Other
'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n        '  Other
'{%'          Comment.Preproc
'- '          Text
'endif'       Keyword
' '           Text
'-'           Text
'%}'          Comment.Preproc
'\n    </div>\n' Other

'{%'          Comment.Preproc
'- '          Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endspaceless' Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\n    \'item\' => array(\n        \'children\' => array(\n            null,\n            null,\n        )\n    )\n)\n--EXPECT--\nElement:<div>Element:<div></div>Element:<div></div></div>\n--TEST--\n"extends" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'standalone'  Name.Variable
' '           Text
'?'           Operator
' '           Text
'foo'         Name.Variable
' '           Text
':'           Operator
' '           Text
"'bar.twig'"  Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'FOO'         Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'FOO'         Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(bar.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'BAR'         Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'foo\' => \'foo.twig\', \'standalone\' => true)\n--EXPECT--\nFOOFOO\n--TEST--\n"extends" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'foo'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'\nFOO\n'     Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'foo\' => \'foo.twig\')\n--EXPECT--\nFOO\n--TEST--\n"extends" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'FOO'         Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nFOO\n--TEST--\n"extends" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'['           Operator
'"foo.twig"'  Literal.String.Double
','           Operator
' '           Text
'"bar.twig"'  Literal.String.Double
']'           Operator
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(bar.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'\nfoo\n'     Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nfoo\n--TEST--\n"extends" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'"layout.twig"' Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'index '      Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(layout.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'"base.twig"' Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'layout '     Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(base.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'base '       Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nbase layout index\n--TEST--\n"block" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    CONTENT\n    ' Other
'{%'          Comment.Preproc
'- '          Text
'block'       Keyword
' '           Text
'subcontent'  Name.Variable
' '           Text
'-'           Text
'%}'          Comment.Preproc
'\n        SUBCONTENT\n    ' Other
'{%'          Comment.Preproc
'- '          Text
'endblock'    Keyword
' '           Text
'-'           Text
'%}'          Comment.Preproc
'\n    ENDCONTENT\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\n--DATA--\nreturn array()\n--EXPECT--\nCONTENTSUBCONTENTENDCONTENT\n--TEST--\n"block" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'subcontent'  Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n        '  Other
'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'subsubcontent' Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n            SUBSUBCONTENT\n        ' Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'subcontent'  Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n        SUBCONTENT\n    ' Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nSUBSUBCONTENT\n--TEST--\n"extends" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'"layout.twig"' Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'inside'      Name.Variable
' '           Text
'%}'          Comment.Preproc
'INSIDE'      Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'inside'      Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(layout.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'"base.twig"' Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'body'        Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'inside'      Name.Variable
' '           Text
"''"          Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'body'        Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(base.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'body'        Name.Variable
' '           Text
"''"          Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nINSIDE\n--TEST--\n"extends" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'foo'         Name.Variable
' '           Text
'?'           Operator
' '           Text
"'foo.twig'"  Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'bar.twig'"  Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\nFOO\n--TEMPLATE(bar.twig)--\nBAR\n--DATA--\nreturn array(\'foo\' => true)\n--EXPECT--\nFOO\n--DATA--\nreturn array(\'foo\' => false)\n--EXPECT--\nBAR\n--TEST--\n"extends" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--EXCEPTION--\nTwig_Error_Syntax: Cannot extend from a block in "index.twig" at line 3\n--TEST--\n"extends" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'"base.twig"' Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'include'     Keyword
' '           Text
'"included.twig"' Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'footer'      Name.Variable
' '           Text
'%}'          Comment.Preproc
'Footer'      Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(included.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'"base.twig"' Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'Included Content' Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(base.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'Default Content' Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'footer'      Name.Variable
' '           Text
'%}'          Comment.Preproc
'Default Footer' Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nIncluded Content\nDefault Footer\nFooter\n--TEST--\n"extends" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n  '        Other
'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'inside'      Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    INSIDE OVERRIDDEN\n  ' Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n  BEFORE\n  ' Other
'{{'          Comment.Preproc
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n  AFTER\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n  BAR\n'   Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n\nINSIDE OVERRIDDEN\n  \n  BEFORE\n    BAR\n\n  AFTER\n--TEST--\n"extends" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'FOO'         Other
'{{'          Comment.Preproc
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'BAR'         Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nBARFOOBAR\n--TEST--\n"parent" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'use'         Keyword
' '           Text
"'foo.twig'"  Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'BAR'         Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nBAR\n--TEST--\n"parent" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--EXCEPTION--\nTwig_Error_Syntax: Calling "parent" on a template that does not extend nor "use" another template is forbidden in "index.twig" at line 3\n--TEST--\n"extends" tag accepts Twig_Template instance\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'foo'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'FOO\n'       Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'BAR'         Other
'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'foo\' => $twig->loadTemplate(\'foo.twig\'))\n--EXPECT--\nBARFOO\n--TEST--\n"parent" function\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'extends'     Keyword
' '           Text
'"parent.twig"' Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'use'         Keyword
' '           Text
'"use1.twig"' Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'use'         Keyword
' '           Text
'"use2.twig"' Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content_parent' Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content_use1' Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content_use2' Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'content_use1_only'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'content_use2_only'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(parent.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content_parent' Name.Variable
' '           Text
"'content_parent'" Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content_use1' Name.Variable
' '           Text
"'content_parent'" Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content_use2' Name.Variable
' '           Text
"'content_parent'" Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
"''"          Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(use1.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content_use1' Name.Variable
' '           Text
"'content_use1'" Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content_use2' Name.Variable
' '           Text
"'content_use1'" Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content_use1_only' Name.Variable
' '           Text
"'content_use1_only'" Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(use2.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content_use2' Name.Variable
' '           Text
"'content_use2'" Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content_use2_only' Name.Variable
' '           Text
"'content_use2_only'" Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n    content_parent\n    content_use1\n    content_use2\n    content_use1_only\n    content_use2_only\n--TEST--\n"macro" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'import'      Keyword
' '           Text
'_self'       Name.Variable
' '           Text
'as'          Name.Variable
' '           Text
'macros'      Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'macros'      Name.Variable
'.input'      Name.Variable
'('           Operator
"'username'"  Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'macros'      Name.Variable
'.input'      Name.Variable
'('           Operator
"'password'"  Literal.String.Single
','           Operator
' '           Text
'null'        Keyword.Pseudo
','           Operator
' '           Text
"'password'"  Literal.String.Single
','           Operator
' '           Text
'1'           Literal.Number
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'macro'       Keyword
' '           Text
'input'       Name.Variable
'('           Operator
'name'        Name.Variable
','           Operator
' '           Text
'value'       Name.Variable
','           Operator
' '           Text
'type'        Name.Variable
','           Operator
' '           Text
'size'        Name.Variable
')'           Operator
' '           Text
'%}'          Comment.Preproc
'\n  <input type="' Other
'{{'          Comment.Preproc
' '           Text
'type'        Name.Variable
'|'           Operator
'default'     Name.Function
'('           Operator
'"text"'      Literal.String.Double
')'           Operator
' '           Text
'}}'          Comment.Preproc
'" name="'    Other
'{{'          Comment.Preproc
' '           Text
'name'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'" value="'   Other
'{{'          Comment.Preproc
' '           Text
'value'       Name.Variable
'|'           Operator
'e'           Name.Function
'|'           Operator
'default'     Name.Function
'('           Operator
"''"          Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'" size="'    Other
'{{'          Comment.Preproc
' '           Text
'size'        Name.Variable
'|'           Operator
'default'     Name.Function
'('           Operator
'2'           Literal.Number
'0'           Literal.Number
')'           Operator
' '           Text
'}}'          Comment.Preproc
'">\n'        Other

'{%'          Comment.Preproc
' '           Text
'endmacro'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n  <input type="text" name="username" value="" size="20">\n\n  <input type="password" name="password" value="" size="1">\n--TEST--\n"macro" tag supports name for endmacro\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'import'      Keyword
' '           Text
'_self'       Name.Variable
' '           Text
'as'          Name.Variable
' '           Text
'macros'      Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'macros'      Name.Variable
'.foo'        Name.Variable
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'macros'      Name.Variable
'.bar'        Name.Variable
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'macro'       Keyword
' '           Text
'foo'         Name.Variable
'('           Operator
')'           Operator
' '           Text
'%}'          Comment.Preproc
'foo'         Other
'{%'          Comment.Preproc
' '           Text
'endmacro'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'macro'       Keyword
' '           Text
'bar'         Name.Variable
'('           Operator
')'           Operator
' '           Text
'%}'          Comment.Preproc
'bar'         Other
'{%'          Comment.Preproc
' '           Text
'endmacro'    Keyword
' '           Text
'bar'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nfoo\nbar\n\n--TEST--\n"macro" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'import'      Keyword
' '           Text
"'forms.twig'" Literal.String.Single
' '           Text
'as'          Name.Variable
' '           Text
'forms'       Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'forms'       Name.Variable
'.input'      Name.Variable
'('           Operator
"'username'"  Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'forms'       Name.Variable
'.input'      Name.Variable
'('           Operator
"'password'"  Literal.String.Single
','           Operator
' '           Text
'null'        Keyword.Pseudo
','           Operator
' '           Text
"'password'"  Literal.String.Single
','           Operator
' '           Text
'1'           Literal.Number
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--TEMPLATE(forms.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'macro'       Keyword
' '           Text
'input'       Name.Variable
'('           Operator
'name'        Name.Variable
','           Operator
' '           Text
'value'       Name.Variable
','           Operator
' '           Text
'type'        Name.Variable
','           Operator
' '           Text
'size'        Name.Variable
')'           Operator
' '           Text
'%}'          Comment.Preproc
'\n  <input type="' Other
'{{'          Comment.Preproc
' '           Text
'type'        Name.Variable
'|'           Operator
'default'     Name.Function
'('           Operator
'"text"'      Literal.String.Double
')'           Operator
' '           Text
'}}'          Comment.Preproc
'" name="'    Other
'{{'          Comment.Preproc
' '           Text
'name'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'" value="'   Other
'{{'          Comment.Preproc
' '           Text
'value'       Name.Variable
'|'           Operator
'e'           Name.Function
'|'           Operator
'default'     Name.Function
'('           Operator
"''"          Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'" size="'    Other
'{{'          Comment.Preproc
' '           Text
'size'        Name.Variable
'|'           Operator
'default'     Name.Function
'('           Operator
'2'           Literal.Number
'0'           Literal.Number
')'           Operator
' '           Text
'}}'          Comment.Preproc
'">\n'        Other

'{%'          Comment.Preproc
' '           Text
'endmacro'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n  <input type="text" name="username" value="" size="20">\n\n  <input type="password" name="password" value="" size="1">\n--TEST--\n"macro" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'from'        Keyword
' '           Text
"'forms.twig'" Literal.String.Single
' '           Text
'import'      Name.Variable
' '           Text
'foo'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'from'        Keyword
' '           Text
"'forms.twig'" Literal.String.Single
' '           Text
'import'      Name.Variable
' '           Text
'foo'         Name.Variable
' '           Text
'as'          Name.Variable
' '           Text
'foobar'      Name.Variable
','           Operator
' '           Text
'bar'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
'('           Operator
"'foo'"       Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'foobar'      Name.Variable
'('           Operator
"'foo'"       Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'bar'         Name.Variable
'('           Operator
"'foo'"       Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--TEMPLATE(forms.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'macro'       Keyword
' '           Text
'foo'         Name.Variable
'('           Operator
'name'        Name.Variable
')'           Operator
' '           Text
'%}'          Comment.Preproc
'foo'         Other
'{{'          Comment.Preproc
' '           Text
'name'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'endmacro'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'macro'       Keyword
' '           Text
'bar'         Name.Variable
'('           Operator
'name'        Name.Variable
')'           Operator
' '           Text
'%}'          Comment.Preproc
'bar'         Other
'{{'          Comment.Preproc
' '           Text
'name'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'endmacro'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nfoofoo\nfoofoo\nbarfoo\n--TEST--\n"macro" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'from'        Keyword
' '           Text
"'forms.twig'" Literal.String.Single
' '           Text
'import'      Name.Variable
' '           Text
'foo'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
'('           Operator
"'foo'"       Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
'('           Operator
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--TEMPLATE(forms.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'macro'       Keyword
' '           Text
'foo'         Name.Variable
'('           Operator
'name'        Name.Variable
')'           Operator
' '           Text
'%}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'name'        Name.Variable
'|'           Operator
'default'     Name.Function
'('           Operator
"'foo'"       Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'global'      Name.Variable
' '           Text
'}}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'endmacro'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nfooglobal\nfooglobal\n--TEST--\n"macro" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'import'      Keyword
' '           Text
'_self'       Name.Variable
' '           Text
'as'          Name.Variable
' '           Text
'forms'       Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'forms'       Name.Variable
'.input'      Name.Variable
'('           Operator
"'username'"  Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'forms'       Name.Variable
'.input'      Name.Variable
'('           Operator
"'password'"  Literal.String.Single
','           Operator
' '           Text
'null'        Keyword.Pseudo
','           Operator
' '           Text
"'password'"  Literal.String.Single
','           Operator
' '           Text
'1'           Literal.Number
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'macro'       Keyword
' '           Text
'input'       Name.Variable
'('           Operator
'name'        Name.Variable
','           Operator
' '           Text
'value'       Name.Variable
','           Operator
' '           Text
'type'        Name.Variable
','           Operator
' '           Text
'size'        Name.Variable
')'           Operator
' '           Text
'%}'          Comment.Preproc
'\n  <input type="' Other
'{{'          Comment.Preproc
' '           Text
'type'        Name.Variable
'|'           Operator
'default'     Name.Function
'('           Operator
'"text"'      Literal.String.Double
')'           Operator
' '           Text
'}}'          Comment.Preproc
'" name="'    Other
'{{'          Comment.Preproc
' '           Text
'name'        Name.Variable
' '           Text
'}}'          Comment.Preproc
'" value="'   Other
'{{'          Comment.Preproc
' '           Text
'value'       Name.Variable
'|'           Operator
'e'           Name.Function
'|'           Operator
'default'     Name.Function
'('           Operator
"''"          Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'" size="'    Other
'{{'          Comment.Preproc
' '           Text
'size'        Name.Variable
'|'           Operator
'default'     Name.Function
'('           Operator
'2'           Literal.Number
'0'           Literal.Number
')'           Operator
' '           Text
'}}'          Comment.Preproc
'">\n'        Other

'{%'          Comment.Preproc
' '           Text
'endmacro'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n  <input type="text" name="username" value="" size="20">\n\n  <input type="password" name="password" value="" size="1">\n--TEST--\n"raw" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'raw'         Keyword
' '           Text
'%}'          Comment.Preproc
'\n{{ foo }}\n' Other

'{%'          Comment.Preproc
' '           Text
'endraw'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n' Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n--TEST--\n"raw" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'raw'         Keyword
' '           Text
'%}'          Comment.Preproc
'\n{{ foo }}\n{% endverbatim %}\n--DATA--\nreturn array()\n--EXCEPTION--\nTwig_Error_Syntax: Unexpected end of file: Unclosed "raw" block in "index.twig" at line 2\n--TEST--\n"raw" tag\n--TEMPLATE--\n1***\n\n{%- raw %}\n    {{ \'bla\' }}\n' Other

'{%'          Comment.Preproc
' '           Text
'endraw'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n1***\n2***\n\n' Other

'{%'          Comment.Preproc
'- '          Text
'raw'         Keyword
' -'          Text
'%}'          Comment.Preproc
"\n    {{ 'bla' }}\n" Other

'{%'          Comment.Preproc
' '           Text
'endraw'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n2***\n3***\n\n' Other

'{%'          Comment.Preproc
'- '          Text
'raw'         Keyword
' -'          Text
'%}'          Comment.Preproc
"\n    {{ 'bla' }}\n" Other

'{%'          Comment.Preproc
' '           Text
'endraw'      Keyword
' -'          Text
'%}'          Comment.Preproc
'\n\n3***\n4***\n\n' Other

'{%'          Comment.Preproc
'- '          Text
'raw'         Keyword
' -'          Text
'%}'          Comment.Preproc
"\n    {{ 'bla' }}\n" Other

'{%'          Comment.Preproc
'- '          Text
'endraw'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n4***\n5***\n\n' Other

'{%'          Comment.Preproc
'- '          Text
'raw'         Keyword
' -'          Text
'%}'          Comment.Preproc
"\n    {{ 'bla' }}\n" Other

'{%'          Comment.Preproc
'- '          Text
'endraw'      Keyword
' -'          Text
'%}'          Comment.Preproc
'\n\n5***\n--DATA--\nreturn array()\n--EXPECT--\n1***\n    ' Other
'{{'          Comment.Preproc
' '           Text
"'bla'"       Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n\n\n1***\n2***' Other
'{{'          Comment.Preproc
' '           Text
"'bla'"       Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n\n\n2***\n3***' Other
'{{'          Comment.Preproc
' '           Text
"'bla'"       Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n3***\n4***' Other
'{{'          Comment.Preproc
' '           Text
"'bla'"       Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n\n4***\n5***' Other
'{{'          Comment.Preproc
' '           Text
"'bla'"       Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'5***\n--TEST--\nsandbox tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
'- '          Text
'sandbox'     Keyword
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{%'          Comment.Preproc
'- '          Text
'include'     Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n    a\n'   Other

'{%'          Comment.Preproc
'- '          Text
'endsandbox'  Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\nfoo\n--EXCEPTION--\nTwig_Error_Syntax: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 4\n--TEST--\nsandbox tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
'- '          Text
'sandbox'     Keyword
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{%'          Comment.Preproc
'- '          Text
'include'     Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n\n    '    Other
'{%'          Comment.Preproc
' '           Text
'if'          Keyword
' '           Text
'1'           Literal.Number
' '           Text
'%}'          Comment.Preproc
'\n        '  Other
'{%'          Comment.Preproc
'- '          Text
'include'     Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{%'          Comment.Preproc
' '           Text
'endif'       Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
'- '          Text
'endsandbox'  Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\nfoo\n--EXCEPTION--\nTwig_Error_Syntax: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 5\n--TEST--\nsandbox tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
'- '          Text
'sandbox'     Keyword
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{%'          Comment.Preproc
'- '          Text
'include'     Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
'- '          Text
'endsandbox'  Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
'- '          Text
'sandbox'     Keyword
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{%'          Comment.Preproc
'- '          Text
'include'     Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{%'          Comment.Preproc
'- '          Text
'include'     Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
'- '          Text
'endsandbox'  Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
'- '          Text
'sandbox'     Keyword
' '           Text
'%}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'include'     Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'endsandbox'  Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\nfoo\n--DATA--\nreturn array()\n--EXPECT--\nfoo\nfoo\nfoo\nfoo\n--TEST--\n"set" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'set'         Keyword
' '           Text
'foo'         Name.Variable
' '           Text
'='           Operator
' '           Text
"'foo'"       Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'set'         Keyword
' '           Text
'bar'         Name.Variable
' '           Text
'='           Operator
' '           Text
"'foo<br />'" Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'bar'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'set'         Keyword
' '           Text
'foo'         Name.Variable
','           Operator
' '           Text
'bar'         Name.Variable
' '           Text
'='           Operator
' '           Text
"'foo'"       Literal.String.Single
','           Operator
' '           Text
"'bar'"       Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'{{'          Comment.Preproc
' '           Text
'bar'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nfoo\nfoo&lt;br /&gt;\n\n\nfoobar\n--TEST--\n"set" tag block empty capture\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'set'         Keyword
' '           Text
'foo'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'{%'          Comment.Preproc
' '           Text
'endset'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'if'          Keyword
' '           Text
'foo'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'FAIL'        Other
'{%'          Comment.Preproc
' '           Text
'endif'       Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n--TEST--\n"set" tag block capture\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'set'         Keyword
' '           Text
'foo'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'f<br />o<br />o' Other
'{%'          Comment.Preproc
' '           Text
'endset'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nf<br />o<br />o\n--TEST--\n"set" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'set'         Keyword
' '           Text
'foo'         Name.Variable
','           Operator
' '           Text
'bar'         Name.Variable
' '           Text
'='           Operator
' '           Text
"'foo'"       Literal.String.Single
' '           Text
'~'           Operator
' '           Text
"'bar'"       Literal.String.Single
','           Operator
' '           Text
"'bar'"       Literal.String.Single
' '           Text
'~'           Operator
' '           Text
"'foo'"       Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'bar'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nfoobar\nbarfoo\n--TEST--\n"spaceless" tag removes whites between HTML tags\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'spaceless'   Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n    <div>   <div>   foo   </div>   </div>\n\n' Other

'{%'          Comment.Preproc
' '           Text
'endspaceless' Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n<div><div>   foo   </div></div>\n--TEST--\n"§" custom tag\n--TEMPLATE--\n' Other

'{'           Other
'% § %}\n--DATA--\nreturn array()\n--EXPECT--\n§\n--TEST--\nWhitespace trimming on tags.\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'5'           Literal.Number
' '           Text
'*'           Operator
' '           Text
"'{#-'"       Literal.String.Single
'|'           Operator
'length'      Name.Function
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'{{-'"       Literal.String.Single
'|'           Operator
'length'      Name.Function
' '           Text
'*'           Operator
' '           Text
'5'           Literal.Number
' '           Text
'+'           Operator
' '           Text
"'{%-'"       Literal.String.Single
'|'           Operator
'length'      Name.Function
' '           Text
'}}'          Comment.Preproc
'\n\nTrim on control tag:\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'i'           Name.Variable
' '           Text
'in'          Keyword
' '           Text
'range'       Name.Variable
'('           Operator
'1'           Literal.Number
','           Operator
' '           Text
'9'           Literal.Number
')'           Operator
' '           Text
'-'           Text
'%}'          Comment.Preproc
'\n\t'        Other
'{{'          Comment.Preproc
' '           Text
'i'           Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
'- '          Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n\nTrim on output tag:\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'i'           Name.Variable
' '           Text
'in'          Keyword
' '           Text
'range'       Name.Variable
'('           Operator
'1'           Literal.Number
','           Operator
' '           Text
'9'           Literal.Number
')'           Operator
' '           Text
'%}'          Comment.Preproc
'\n\t'        Other
'{{'          Comment.Preproc
'-'           Operator
' '           Text
'i'           Name.Variable
' '           Text
'-'           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n\nTrim comments:\n      \n' Other

'{#- Invisible -#}' Comment
'\n       \nAfter the comment.\n\nTrim leading space:\n' Other

'{%'          Comment.Preproc
' '           Text
'if'          Keyword
' '           Text
'leading'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n\n\t\t'    Other
'{{'          Comment.Preproc
'-'           Operator
' '           Text
'leading'     Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endif'       Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
'- '          Text
'if'          Keyword
' '           Text
'leading'     Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n\t'        Other
'{{'          Comment.Preproc
'-'           Operator
' '           Text
'leading'     Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
'- '          Text
'endif'       Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n\nTrim trailing space:\n' Other

'{%'          Comment.Preproc
' '           Text
'if'          Keyword
' '           Text
'trailing'    Name.Variable
' '           Text
'-'           Text
'%}'          Comment.Preproc
'          \n\t' Other
'{{'          Comment.Preproc
' '           Text
'trailing'    Name.Variable
' '           Text
'-'           Text
'}}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'endif'       Keyword
' '           Text
'-'           Text
'%}'          Comment.Preproc
'\n\nCombined:\n\n' Other

'{%'          Comment.Preproc
'- '          Text
'if'          Keyword
' '           Text
'both'        Name.Variable
' '           Text
'-'           Text
'%}'          Comment.Preproc
'\n<ul>\n\t<li>    ' Other
'{{'          Comment.Preproc
'-'           Operator
' '           Text
'both'        Name.Variable
' '           Text
'-'           Text
'}}'          Comment.Preproc
'   </li>\n</ul>\n\n' Other

'{%'          Comment.Preproc
'- '          Text
'endif'       Keyword
' '           Text
'-'           Text
'%}'          Comment.Preproc
'\n\nend\n--DATA--\nreturn array(\'leading\' => \'leading space\', \'trailing\' => \'trailing space\', \'both\' => \'both\')\n--EXPECT--\n15\n18\n\nTrim on control tag:\n123456789\n\nTrim on output tag:\n123456789\n\nTrim comments:After the comment.\n\nTrim leading space:\nleading space\nleading space\n\nTrim trailing space:\ntrailing spaceCombined:<ul>\n\t<li>both</li>\n</ul>end\n--TEST--\n"use" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'use'         Keyword
' '           Text
'"blocks.twig"' Literal.String.Double
' '           Text
'with'        Name.Variable
' '           Text
'content'     Name.Variable
' '           Text
'as'          Name.Variable
' '           Text
'foo'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'foo'"       Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--TEMPLATE(blocks.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
"'foo'"       Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nfoo\n--TEST--\n"use" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'use'         Keyword
' '           Text
'"blocks.twig"' Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'content'"   Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--TEMPLATE(blocks.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
"'foo'"       Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nfoo\n--TEST--\n"use" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'use'         Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'use'         Keyword
' '           Text
'"bar.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(bar.twig)--\n--DATA--\nreturn array()\n--EXPECT--\n--TEST--\n"use" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'use'         Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'content'"   Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'foo'"       Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'bar'"       Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'use'         Keyword
' '           Text
'"bar.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
"'foo'"       Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'foo'         Name.Variable
' '           Text
"'foo'"       Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(bar.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
"'bar'"       Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'bar'         Name.Variable
' '           Text
"'bar'"       Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nfoo\nfoo\nbar\n--TEST--\n"use" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'use'         Keyword
' '           Text
'"ancestor.twig"' Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'use'         Keyword
' '           Text
'"parent.twig"' Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'container'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--TEMPLATE(parent.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'sub_container' Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    <div class="overriden_sub_container">overriden sub_container</div>\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(ancestor.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'container'   Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    <div class="container">' Other
'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'sub_container'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'</div>\n'    Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'sub_container' Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    <div class="sub_container">sub_container</div>\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n<div class="container">    <div class="overriden_sub_container">overriden sub_container</div>\n</div>\n--TEST--\n"use" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'use'         Keyword
' '           Text
'"parent.twig"' Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'container'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--TEMPLATE(parent.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'use'         Keyword
' '           Text
'"ancestor.twig"' Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'sub_container' Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    <div class="overriden_sub_container">overriden sub_container</div>\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(ancestor.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'container'   Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    <div class="container">' Other
'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'sub_container'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'</div>\n'    Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'sub_container' Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    <div class="sub_container">sub_container</div>\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n<div class="container">    <div class="overriden_sub_container">overriden sub_container</div>\n</div>\n--TEST--\n"use" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'use'         Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'with'        Name.Variable
' '           Text
'content'     Name.Variable
' '           Text
'as'          Name.Variable
' '           Text
'foo_content' Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'use'         Keyword
' '           Text
'"bar.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'content'"   Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'foo'"       Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'bar'"       Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'foo_content'" Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
"'foo'"       Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'foo'         Name.Variable
' '           Text
"'foo'"       Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(bar.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
"'bar'"       Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'bar'         Name.Variable
' '           Text
"'bar'"       Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nbar\nfoo\nbar\nfoo\n--TEST--\n"use" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'use'         Keyword
' '           Text
'"foo.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'use'         Keyword
' '           Text
'"bar.twig"'  Literal.String.Double
' '           Text
'%}'          Comment.Preproc
'\n\n'        Other

'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'content'"   Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'foo'"       Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'block'       Name.Builtin
'('           Operator
"'bar'"       Literal.String.Single
')'           Operator
' '           Text
'}}'          Comment.Preproc
'\n--TEMPLATE(foo.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
"'foo'"       Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'foo'         Name.Variable
' '           Text
"'foo'"       Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(bar.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'content'     Name.Variable
' '           Text
"'bar'"       Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'bar'         Name.Variable
' '           Text
"'bar'"       Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nbar\nfoo\nbar\n--TEST--\n"use" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'use'         Keyword
' '           Text
"'file2.html.twig'" Literal.String.Single
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'foobar'      Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
'-'           Operator
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'-'           Text
'}}'          Comment.Preproc
'\n    Content of block (second override)\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'foobar'      Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(file2.html.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'use'         Keyword
' '           Text
"'file1.html.twig'" Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'foobar'      Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
'-'           Operator
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'-'           Text
'}}'          Comment.Preproc
'\n    Content of block (first override)\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'foobar'      Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(file1.html.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'foobar'      Name.Variable
' '           Text
'-'           Text
'%}'          Comment.Preproc
'\n    Content of block\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'foobar'      Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nContent of block\nContent of block (first override)\nContent of block (second override)\n--TEST--\n"use" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'use'         Keyword
' '           Text
"'file2.html.twig'" Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'use'         Keyword
' '           Text
"'file1.html.twig'" Literal.String.Single
' '           Text
'with'        Name.Variable
' '           Text
'foo'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'foo'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
'-'           Operator
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'-'           Text
'}}'          Comment.Preproc
'\n    Content of foo (second override)\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'foo'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'bar'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
'-'           Operator
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'-'           Text
'}}'          Comment.Preproc
'\n    Content of bar (second override)\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'bar'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(file2.html.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'use'         Keyword
' '           Text
"'file1.html.twig'" Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'foo'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
'-'           Operator
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'-'           Text
'}}'          Comment.Preproc
'\n    Content of foo (first override)\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'foo'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'bar'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
'-'           Operator
' '           Text
'parent'      Name.Builtin
'('           Operator
')'           Operator
' '           Text
'-'           Text
'}}'          Comment.Preproc
'\n    Content of bar (first override)\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'bar'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(file1.html.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'foo'         Name.Variable
' '           Text
'-'           Text
'%}'          Comment.Preproc
'\n    Content of foo\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'foo'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'bar'         Name.Variable
' '           Text
'-'           Text
'%}'          Comment.Preproc
'\n    Content of bar\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'bar'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nContent of foo\nContent of foo (first override)\nContent of foo (second override)\nContent of bar\nContent of bar (second override)\n--TEST--\n"use" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'use'         Keyword
' '           Text
"'file2.html.twig'" Literal.String.Single
' '           Text
'with'        Name.Variable
' '           Text
'foobar'      Name.Variable
' '           Text
'as'          Name.Variable
' '           Text
'base_base_foobar' Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'foobar'      Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
'-'           Operator
' '           Text
'block'       Name.Builtin
'('           Operator
"'base_base_foobar'" Literal.String.Single
')'           Operator
' '           Text
'-'           Text
'}}'          Comment.Preproc
'\n    Content of block (second override)\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'foobar'      Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(file2.html.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'use'         Keyword
' '           Text
"'file1.html.twig'" Literal.String.Single
' '           Text
'with'        Name.Variable
' '           Text
'foobar'      Name.Variable
' '           Text
'as'          Name.Variable
' '           Text
'base_foobar' Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'foobar'      Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n    '      Other
'{{'          Comment.Preproc
'-'           Operator
' '           Text
'block'       Name.Builtin
'('           Operator
"'base_foobar'" Literal.String.Single
')'           Operator
' '           Text
'-'           Text
'}}'          Comment.Preproc
'\n    Content of block (first override)\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'foobar'      Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n--TEMPLATE(file1.html.twig)--\n' Other

'{%'          Comment.Preproc
' '           Text
'block'       Keyword
' '           Text
'foobar'      Name.Variable
' '           Text
'-'           Text
'%}'          Comment.Preproc
'\n    Content of block\n' Other

'{%'          Comment.Preproc
' '           Text
'endblock'    Keyword
' '           Text
'foobar'      Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nContent of block\nContent of block (first override)\nContent of block (second override)\n--TEST--\n"verbatim" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'verbatim'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n{{ foo }}\n' Other

'{%'          Comment.Preproc
' '           Text
'endverbatim' Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\n' Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n--TEST--\n"verbatim" tag\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'verbatim'    Keyword
' '           Text
'%}'          Comment.Preproc
'\n{{ foo }}\n{% endraw %}\n--DATA--\nreturn array()\n--EXCEPTION--\nTwig_Error_Syntax: Unexpected end of file: Unclosed "verbatim" block in "index.twig" at line 2\n--TEST--\n"verbatim" tag\n--TEMPLATE--\n1***\n\n{%- verbatim %}\n    {{ \'bla\' }}\n' Other

'{%'          Comment.Preproc
' '           Text
'endverbatim' Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n1***\n2***\n\n' Other

'{%'          Comment.Preproc
'- '          Text
'verbatim'    Keyword
' -'          Text
'%}'          Comment.Preproc
"\n    {{ 'bla' }}\n" Other

'{%'          Comment.Preproc
' '           Text
'endverbatim' Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n2***\n3***\n\n' Other

'{%'          Comment.Preproc
'- '          Text
'verbatim'    Keyword
' -'          Text
'%}'          Comment.Preproc
"\n    {{ 'bla' }}\n" Other

'{%'          Comment.Preproc
' '           Text
'endverbatim' Keyword
' -'          Text
'%}'          Comment.Preproc
'\n\n3***\n4***\n\n' Other

'{%'          Comment.Preproc
'- '          Text
'verbatim'    Keyword
' -'          Text
'%}'          Comment.Preproc
"\n    {{ 'bla' }}\n" Other

'{%'          Comment.Preproc
'- '          Text
'endverbatim' Keyword
' '           Text
'%}'          Comment.Preproc
'\n\n4***\n5***\n\n' Other

'{%'          Comment.Preproc
'- '          Text
'verbatim'    Keyword
' -'          Text
'%}'          Comment.Preproc
"\n    {{ 'bla' }}\n" Other

'{%'          Comment.Preproc
'- '          Text
'endverbatim' Keyword
' -'          Text
'%}'          Comment.Preproc
'\n\n5***\n--DATA--\nreturn array()\n--EXPECT--\n1***\n    ' Other
'{{'          Comment.Preproc
' '           Text
"'bla'"       Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n\n\n1***\n2***' Other
'{{'          Comment.Preproc
' '           Text
"'bla'"       Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n\n\n2***\n3***' Other
'{{'          Comment.Preproc
' '           Text
"'bla'"       Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n3***\n4***' Other
'{{'          Comment.Preproc
' '           Text
"'bla'"       Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n\n4***\n5***' Other
'{{'          Comment.Preproc
' '           Text
"'bla'"       Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'5***\n--TEST--\narray index test\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'for'         Keyword
' '           Text
'key'         Name.Variable
','           Operator
' '           Text
'value'       Name.Variable
' '           Text
'in'          Keyword
' '           Text
'days'        Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'key'         Name.Variable
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'endfor'      Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\nreturn array(\'days\' => array(\n    1  => array(\'money\' => 9),\n    2  => array(\'money\' => 21),\n    3  => array(\'money\' => 38),\n    4  => array(\'money\' => 6),\n    18 => array(\'money\' => 6),\n    19 => array(\'money\' => 3),\n    31 => array(\'money\' => 11),\n));\n--EXPECT--\n1\n2\n3\n4\n18\n19\n31\n--TEST--\n"const" test\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'8'           Literal.Number
' '           Text
'is'          Keyword
' '           Text
'constant'    Name.Function
'('           Operator
"'E_NOTICE'"  Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'no'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'bar'"       Literal.String.Single
' '           Text
'is'          Keyword
' '           Text
'constant'    Name.Function
'('           Operator
"'TwigTestFoo::BAR_NAME'" Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'no'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'value'       Name.Variable
' '           Text
'is'          Keyword
' '           Text
'constant'    Name.Function
'('           Operator
"'TwigTestFoo::BAR_NAME'" Literal.String.Single
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'no'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'2'           Literal.Number
' '           Text
'is'          Keyword
' '           Text
'constant'    Name.Function
'('           Operator
"'ARRAY_AS_PROPS'" Literal.String.Single
','           Operator
' '           Text
'object'      Name.Variable
')'           Operator
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'no'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\'value\' => \'bar\', \'object\' => new ArrayObject(array(\'hi\')));\n--EXPECT--\nok\nok\nok\nok--TEST--\n"defined" test\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'definedVar'  Name.Variable
'                     ' Text
'is'          Keyword
'     '       Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'definedVar'  Name.Variable
'                     ' Text
'is'          Keyword
' '           Text
'not'         Keyword
' '           Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'undefinedVar' Name.Variable
'                   ' Text
'is'          Keyword
'     '       Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'undefinedVar' Name.Variable
'                   ' Text
'is'          Keyword
' '           Text
'not'         Keyword
' '           Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'zeroVar'     Name.Variable
'                        ' Text
'is'          Keyword
'     '       Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'nullVar'     Name.Variable
'                        ' Text
'is'          Keyword
'     '       Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'nested'      Name.Variable
'.definedVar' Name.Variable
'              ' Text
'is'          Keyword
'     '       Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'nested'      Name.Variable
'['           Operator
"'definedVar'" Literal.String.Single
']'           Operator
'           ' Text
'is'          Keyword
'     '       Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'nested'      Name.Variable
'.definedVar' Name.Variable
'              ' Text
'is'          Keyword
' '           Text
'not'         Keyword
' '           Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'nested'      Name.Variable
'.undefinedVar' Name.Variable
'            ' Text
'is'          Keyword
'     '       Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'nested'      Name.Variable
'['           Operator
"'undefinedVar'" Literal.String.Single
']'           Operator
'         '   Text
'is'          Keyword
'     '       Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'nested'      Name.Variable
'.undefinedVar' Name.Variable
'            ' Text
'is'          Keyword
' '           Text
'not'         Keyword
' '           Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'nested'      Name.Variable
'.zeroVar'    Name.Variable
'                 ' Text
'is'          Keyword
'     '       Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'nested'      Name.Variable
'.nullVar'    Name.Variable
'                 ' Text
'is'          Keyword
'     '       Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'nested'      Name.Variable
'.definedArray' Name.Variable
'.0'          Literal.Number
'          '  Text
'is'          Keyword
'     '       Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'nested'      Name.Variable
'['           Operator
"'definedArray'" Literal.String.Single
']'           Operator
'['           Operator
'0'           Literal.Number
']'           Operator
'      '      Text
'is'          Keyword
'     '       Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'object'      Name.Variable
'.foo'        Name.Variable
'                     ' Text
'is'          Keyword
'     '       Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'object'      Name.Variable
'.undefinedMethod' Name.Variable
'         '   Text
'is'          Keyword
'     '       Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'object'      Name.Variable
'.getFoo'     Name.Variable
'('           Operator
')'           Operator
'                ' Text
'is'          Keyword
'     '       Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'object'      Name.Variable
'.getFoo'     Name.Variable
'('           Operator
"'a'"         Literal.String.Single
')'           Operator
'             ' Text
'is'          Keyword
'     '       Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'object'      Name.Variable
'.undefinedMethod' Name.Variable
'('           Operator
')'           Operator
'       '     Text
'is'          Keyword
'     '       Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'object'      Name.Variable
'.undefinedMethod' Name.Variable
'('           Operator
"'a'"         Literal.String.Single
')'           Operator
'    '        Text
'is'          Keyword
'     '       Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'object'      Name.Variable
'.self'       Name.Variable
'.foo'        Name.Variable
'                ' Text
'is'          Keyword
'     '       Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'object'      Name.Variable
'.self'       Name.Variable
'.undefinedMethod' Name.Variable
'    '        Text
'is'          Keyword
'     '       Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'object'      Name.Variable
'.undefinedMethod' Name.Variable
'.self'       Name.Variable
'    '        Text
'is'          Keyword
'     '       Text
'defined'     Name.Function
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\n    \'definedVar\' => \'defined\',\n    \'zeroVar\'    => 0,\n    \'nullVar\'    => null,\n    \'nested\'      => array(\n        \'definedVar\'   => \'defined\',\n        \'zeroVar\'      => 0,\n        \'nullVar\'      => null,\n        \'definedArray\' => array(0),\n    ),\n    \'object\' => new TwigTestFoo(),\n);\n--EXPECT--\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\n--DATA--\nreturn array(\n    \'definedVar\' => \'defined\',\n    \'zeroVar\'    => 0,\n    \'nullVar\'    => null,\n    \'nested\'      => array(\n        \'definedVar\'   => \'defined\',\n        \'zeroVar\'      => 0,\n        \'nullVar\'      => null,\n        \'definedArray\' => array(0),\n    ),\n    \'object\' => new TwigTestFoo(),\n);\n--CONFIG--\nreturn array(\'strict_variables\' => false)\n--EXPECT--\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\nok\n--TEST--\n"empty" test\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
' '           Text
'is'          Keyword
' '           Text
'empty'       Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'bar'         Name.Variable
' '           Text
'is'          Keyword
' '           Text
'empty'       Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'foobar'      Name.Variable
' '           Text
'is'          Keyword
' '           Text
'empty'       Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'array'       Name.Variable
' '           Text
'is'          Keyword
' '           Text
'empty'       Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'zero'        Name.Variable
' '           Text
'is'          Keyword
' '           Text
'empty'       Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'string'      Name.Variable
' '           Text
'is'          Keyword
' '           Text
'empty'       Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'countable_empty' Name.Variable
' '           Text
'is'          Keyword
' '           Text
'empty'       Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'countable_not_empty' Name.Variable
' '           Text
'is'          Keyword
' '           Text
'empty'       Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'markup_empty' Name.Variable
' '           Text
'is'          Keyword
' '           Text
'empty'       Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'markup_not_empty' Name.Variable
' '           Text
'is'          Keyword
' '           Text
'empty'       Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\n\nclass CountableStub implements Countable\n' Other

'{'           Other
'\n    private $items;\n\n    public function __construct(array $items)\n    ' Other
'{'           Other
'\n        $this->items = $items;\n    }\n\n    public function count()\n    ' Other
'{'           Other
'\n        return count($this->items);\n    }\n}\nreturn array(\n    \'foo\' => \'\', \'bar\' => null, \'foobar\' => false, \'array\' => array(), \'zero\' => 0, \'string\' => \'0\',\n    \'countable_empty\' => new CountableStub(array()), \'countable_not_empty\' => new CountableStub(array(1, 2)),\n    \'markup_empty\' => new Twig_Markup(\'\', \'UTF-8\'), \'markup_not_empty\' => new Twig_Markup(\'test\', \'UTF-8\'),\n);\n--EXPECT--\nok\nok\nok\nok\nko\nko\nok\nko\nok\nko\n--TEST--\n"even" test\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'is'          Keyword
' '           Text
'even'        Name.Function
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'2'           Literal.Number
' '           Text
'is'          Keyword
' '           Text
'even'        Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'is'          Keyword
' '           Text
'not'         Keyword
' '           Text
'even'        Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'2'           Literal.Number
' '           Text
'is'          Keyword
' '           Text
'not'         Keyword
' '           Text
'even'        Name.Function
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nok\nok\nok\nok\n--TEST--\nTwig supports the in operator\n--TEMPLATE--\n' Other

'{%'          Comment.Preproc
' '           Text
'if'          Keyword
' '           Text
'bar'         Name.Variable
' '           Text
'in'          Keyword
' '           Text
'foo'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\nTRUE\n'    Other

'{%'          Comment.Preproc
' '           Text
'endif'       Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'if'          Keyword
' '           Text
'not'         Keyword
' '           Text
'('           Operator
'bar'         Name.Variable
' '           Text
'in'          Keyword
' '           Text
'foo'         Name.Variable
')'           Operator
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'else'        Keyword
' '           Text
'%}'          Comment.Preproc
'\nTRUE\n'    Other

'{%'          Comment.Preproc
' '           Text
'endif'       Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'if'          Keyword
' '           Text
'bar'         Name.Variable
' '           Text
'not'         Keyword
' '           Text
'in'          Keyword
' '           Text
'foo'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'else'        Keyword
' '           Text
'%}'          Comment.Preproc
'\nTRUE\n'    Other

'{%'          Comment.Preproc
' '           Text
'endif'       Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'if'          Keyword
' '           Text
"'a'"         Literal.String.Single
' '           Text
'in'          Keyword
' '           Text
'bar'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\nTRUE\n'    Other

'{%'          Comment.Preproc
' '           Text
'endif'       Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'if'          Keyword
' '           Text
"'c'"         Literal.String.Single
' '           Text
'not'         Keyword
' '           Text
'in'          Keyword
' '           Text
'bar'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\nTRUE\n'    Other

'{%'          Comment.Preproc
' '           Text
'endif'       Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'if'          Keyword
' '           Text
"''"          Literal.String.Single
' '           Text
'not'         Keyword
' '           Text
'in'          Keyword
' '           Text
'bar'         Name.Variable
' '           Text
'%}'          Comment.Preproc
'\nTRUE\n'    Other

'{%'          Comment.Preproc
' '           Text
'endif'       Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'if'          Keyword
' '           Text
"''"          Literal.String.Single
' '           Text
'in'          Keyword
' '           Text
"''"          Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\nTRUE\n'    Other

'{%'          Comment.Preproc
' '           Text
'endif'       Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'if'          Keyword
' '           Text
"'0'"         Literal.String.Single
' '           Text
'not'         Keyword
' '           Text
'in'          Keyword
' '           Text
"''"          Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\nTRUE\n'    Other

'{%'          Comment.Preproc
' '           Text
'endif'       Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'if'          Keyword
' '           Text
"'a'"         Literal.String.Single
' '           Text
'not'         Keyword
' '           Text
'in'          Keyword
' '           Text
"'0'"         Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\nTRUE\n'    Other

'{%'          Comment.Preproc
' '           Text
'endif'       Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{%'          Comment.Preproc
' '           Text
'if'          Keyword
' '           Text
"'0'"         Literal.String.Single
' '           Text
'in'          Keyword
' '           Text
"'0'"         Literal.String.Single
' '           Text
'%}'          Comment.Preproc
'\nTRUE\n'    Other

'{%'          Comment.Preproc
' '           Text
'endif'       Keyword
' '           Text
'%}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'false'       Keyword.Pseudo
' '           Text
'in'          Keyword
' '           Text
'['           Operator
'0'           Literal.Number
','           Operator
' '           Text
'1'           Literal.Number
']'           Operator
' '           Text
'?'           Operator
' '           Text
"'TRUE'"      Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'FALSE'"     Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'true'        Keyword.Pseudo
' '           Text
'in'          Keyword
' '           Text
'['           Operator
'0'           Literal.Number
','           Operator
' '           Text
'1'           Literal.Number
']'           Operator
' '           Text
'?'           Operator
' '           Text
"'TRUE'"      Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'FALSE'"     Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"'0'"         Literal.String.Single
' '           Text
'in'          Keyword
' '           Text
'['           Operator
'0'           Literal.Number
','           Operator
' '           Text
'1'           Literal.Number
']'           Operator
' '           Text
'?'           Operator
' '           Text
"'TRUE'"      Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'FALSE'"     Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"''"          Literal.String.Single
' '           Text
'in'          Keyword
' '           Text
'['           Operator
'0'           Literal.Number
','           Operator
' '           Text
'1'           Literal.Number
']'           Operator
' '           Text
'?'           Operator
' '           Text
"'TRUE'"      Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'FALSE'"     Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'0'           Literal.Number
' '           Text
'in'          Keyword
' '           Text
'['           Operator
"''"          Literal.String.Single
','           Operator
' '           Text
'1'           Literal.Number
']'           Operator
' '           Text
'?'           Operator
' '           Text
"'TRUE'"      Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'FALSE'"     Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
"''"          Literal.String.Single
' '           Text
'in'          Keyword
' '           Text
"'foo'"       Literal.String.Single
' '           Text
'?'           Operator
' '           Text
"'TRUE'"      Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'FALSE'"     Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'0'           Literal.Number
' '           Text
'in'          Keyword
' '           Text
"'foo'"       Literal.String.Single
' '           Text
'?'           Operator
' '           Text
"'TRUE'"      Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'FALSE'"     Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'false'       Keyword.Pseudo
' '           Text
'in'          Keyword
' '           Text
"'foo'"       Literal.String.Single
' '           Text
'?'           Operator
' '           Text
"'TRUE'"      Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'FALSE'"     Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'true'        Keyword.Pseudo
' '           Text
'in'          Keyword
' '           Text
"'100'"       Literal.String.Single
' '           Text
'?'           Operator
' '           Text
"'TRUE'"      Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'FALSE'"     Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'['           Operator
']'           Operator
' '           Text
'in'          Keyword
' '           Text
"'Array'"     Literal.String.Single
' '           Text
'?'           Operator
' '           Text
"'TRUE'"      Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'FALSE'"     Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'['           Operator
']'           Operator
' '           Text
'in'          Keyword
' '           Text
'['           Operator
'true'        Keyword.Pseudo
','           Operator
' '           Text
'false'       Keyword.Pseudo
']'           Operator
' '           Text
'?'           Operator
' '           Text
"'TRUE'"      Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'FALSE'"     Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'['           Operator
']'           Operator
' '           Text
'in'          Keyword
' '           Text
'['           Operator
'true'        Keyword.Pseudo
','           Operator
' '           Text
"''"          Literal.String.Single
']'           Operator
' '           Text
'?'           Operator
' '           Text
"'TRUE'"      Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'FALSE'"     Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'['           Operator
']'           Operator
' '           Text
'in'          Keyword
' '           Text
'['           Operator
'true'        Keyword.Pseudo
','           Operator
' '           Text
'['           Operator
']'           Operator
']'           Operator
' '           Text
'?'           Operator
' '           Text
"'TRUE'"      Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'FALSE'"     Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'dir_object'  Name.Variable
' '           Text
'in'          Keyword
' '           Text
"'foo'"       Literal.String.Single
'~'           Operator
'dir_name'    Name.Variable
' '           Text
'?'           Operator
' '           Text
"'TRUE'"      Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'FALSE'"     Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'5'           Literal.Number
' '           Text
'in'          Keyword
' '           Text
'1'           Literal.Number
'2'           Literal.Number
'5'           Literal.Number
' '           Text
'?'           Operator
' '           Text
"'TRUE'"      Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'FALSE'"     Literal.String.Single
' '           Text
'}}'          Comment.Preproc
"\n--DATA--\nreturn array('bar' => 'bar', 'foo' => array('bar' => 'bar'), 'dir_name' => dirname(__FILE__), 'dir_object' => new SplFileInfo(dirname(__FILE__)))\n--EXPECT--\nTRUE\nTRUE\nTRUE\nTRUE\nTRUE\nTRUE\nTRUE\nTRUE\nTRUE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nTRUE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nTRUE\nFALSE\nFALSE\n--TEST--\nTwig supports the in operator when using objects\n--TEMPLATE--\n" Other

'{%'          Comment.Preproc
' '           Text
'if'          Keyword
' '           Text
'object'      Name.Variable
' '           Text
'in'          Keyword
' '           Text
'object_list' Name.Variable
' '           Text
'%}'          Comment.Preproc
'\nTRUE\n'    Other

'{%'          Comment.Preproc
' '           Text
'endif'       Keyword
' '           Text
'%}'          Comment.Preproc
'\n--DATA--\n$foo = new TwigTestFoo();\n$foo1 = new TwigTestFoo();\n\n$foo->position = $foo1;\n$foo1->position = $foo;\n\nreturn array(\n    \'object\'      => $foo,\n    \'object_list\' => array($foo1, $foo),\n);\n--EXPECT--\nTRUE\n--TEST--\n"iterable" test\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'foo'         Name.Variable
' '           Text
'is'          Keyword
' '           Text
'iterable'    Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'traversable' Name.Variable
' '           Text
'is'          Keyword
' '           Text
'iterable'    Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'obj'         Name.Variable
' '           Text
'is'          Keyword
' '           Text
'iterable'    Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'val'         Name.Variable
' '           Text
'is'          Keyword
' '           Text
'iterable'    Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array(\n    \'foo\' => array(),\n    \'traversable\' => new ArrayIterator(array()),\n    \'obj\' => new stdClass(),\n    \'val\' => \'test\',\n);\n--EXPECT--\nok\nok\nko\nko--TEST--\n"odd" test\n--TEMPLATE--\n' Other

'{{'          Comment.Preproc
' '           Text
'1'           Literal.Number
' '           Text
'is'          Keyword
' '           Text
'odd'         Name.Function
' '           Text
'?'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n'          Other

'{{'          Comment.Preproc
' '           Text
'2'           Literal.Number
' '           Text
'is'          Keyword
' '           Text
'odd'         Name.Function
' '           Text
'?'           Operator
' '           Text
"'ko'"        Literal.String.Single
' '           Text
':'           Operator
' '           Text
"'ok'"        Literal.String.Single
' '           Text
'}}'          Comment.Preproc
'\n--DATA--\nreturn array()\n--EXPECT--\nok\nok\n' Other
