===============
Simple variable
===============

Lorem {{ ipsum }} dolor sit amet

---

(template
  (content)
  (output_directive
    (variable))
  (content))

=============
Function call
=============

Lorem {{ ipsum() }} dolor sit amet

---

(template
  (content)
  (output_directive
  (function_call
    (function_identifier)
    (arguments)))
  (content))

==========================
Function call w/ arguments
==========================

Lorem {{ ipsum(test, test) }} dolor sit amet

---

(template
  (content)
  (output_directive
  (function_call
    (function_identifier)
    (arguments
    (argument
      (argument_value
      (variable)))
    (argument
      (argument_value
      (variable))))))
  (content))

===================
Variable and filter
===================

Lorem {{ ipsum | filter }} dolor sit amet

---

(template
  (content)
  (output_directive
  (variable)
  (filter
    (filter_identifier)))
  (content))

===========================
Variable and filter w/ args
===========================

Lorem {{ ipsum | filter(arg) }} dolor sit amet

---

(template
  (content)
  (output_directive
  (variable)
  (filter
    (filter_identifier)
    (arguments
    (argument
      (argument_value
      (variable))))))
  (content))

=============================
Variable and filter w/ string
=============================

Lorem {{ ipsum | filter('arg') }} dolor sit amet

---

(template
  (content)
  (output_directive
  (variable)
  (filter
    (filter_identifier)
    (arguments
    (argument
      (argument_value
      (string))))))
  (content))

=================
string and filter
=================

Lorem {{ 'ipsum' | filter }} dolor sit amet

---

(template
  (content)
  (output_directive
  (string)
  (filter
    (filter_identifier)))
  (content))

================================
Function call w/ named arguments
================================

{{ convert_encoding(from='iso-2022-jp', to=encoding) }}

---

(template
  (output_directive
  (function_call
    (function_identifier)
    (arguments
    (argument
      (argument_name)
      (argument_value
      (string)))
    (argument
      (argument_name)
      (argument_value
      (variable))))))
  (content))

=======
Numbers
=======

{{ test(789654) }}

---

(template
  (output_directive
  (function_call
    (function_identifier)
    (arguments
    (argument
      (argument_value
      (number))))))
  (content)
  )

=====
Float
=====

{{ 7896.54 }}

---

(template
 (output_directive
  (number))
  (content))

=================
binary expression
=================

{{ test() ~ 'test' }}

---

(template
 (output_directive
  (binary_expression
   (function_call
    (function_identifier)
    (arguments))
   (operator)
   (string)))
  (content)
 )

===========================
binary expression w/ filter
===========================

{{ test()|value ~ 'test'|length }}

---

(template
 (output_directive
  (binary_expression
   (function_call
    (function_identifier)
    (arguments))
   (filter
    (filter_identifier))
   (operator)
   (string)
   (filter
    (filter_identifier))))
  (content))

======================
parenthesis precedence
======================

{{ (greeting ~ name)|lower }}

---

(template
 (output_directive
  (binary_expression
   (variable)
   (operator)
   (variable))
   (filter
    (filter_identifier)))
  (content))

======
Arrays
======

{{ ["test", test(), test|filter] }}

---

(template
 (output_directive
  (array
    (interpolated_string)
    (function_call
      (function_identifier)
      (arguments))
    (variable)
    (filter
      (filter_identifier))))
  (content))

======
Hashes
======

{{ { 'foo': 'foo', bar: 'bar', 2: 'foo', foo, (foo): 'foo', (1 + 1): 'bar', (foo ~ 'b'): 'baz' } }}

---

(template
  (output_directive
    (hash
      (hash_key
        (string))
      (hash_value
        (string))
      (hash_key
        (name))
      (hash_value
        (string))
      (hash_key
        (number))
      (hash_value
        (string))
      (hash_value
        (variable))
      (hash_key
        (variable))
      (hash_value
        (string))
      (hash_key
        (binary_expression
          (number)
          (operator)
          (number)))
      (hash_value
        (string))
      (hash_key
        (binary_expression
          (variable)
          (operator)
          (string)))
      (hash_value
        (string))))
  (content))

=======
Ternary
=======

{{ foo ? 'yes' : 'no' }}

---

(template
  (output_directive
    (ternary_expression
      (variable)
      (string)
      (string)))
  (content))

=====
arrow
=====

{{ people|map(p => "ezfze")|join(', ') }}

---

(template
  (output_directive
    (variable)
    (filter
      (filter_identifier)
      (arguments
        (argument
          (arrow_function
            (name)
            (interpolated_string)))))
    (filter
      (filter_identifier)
      (arguments
        (argument
          (argument_value
            (string))))))
  (content))

==============
Trailing comma
==============

{{ form_widget(child, {
    parent_label_class: label_attr.class|default(''),
}) }}

---

(template
 (output_directive
   (function_call
     (function_identifier)
     (arguments
       (argument
         (argument_value
           (variable)))
       (argument
         (argument_value
           (hash
             (hash_key
               (name))
             (hash_value
               (variable)
               (filter
                 (filter_identifier)
                 (arguments
                   (argument
                     (argument_value
                       (string))))))))))))
 (content))

============
Array access
============

{{ foo['bar'] }}

---

(template
  (output_directive
    (variable
      (string)))
  (content))

============
Array slice
============

{{ foo[0:2] }}

---

(template
  (output_directive
    (variable
      (number)
      (number)))
  (content))

=============
Array slice 2
=============

{{ foo[:2] }}

---

(template
  (output_directive
    (variable
      (number)))
  (content))

=============
Array slice 3
=============

{{ foo[0:] }}

---

(template
  (output_directive
    (variable
      (number)))
  (content))

============
Fake ternary
============

{{ test ? 'ok' }}

---

(template
  (output_directive
    (ternary_expression
      (variable)
      (string)))
  (content))
