{% macro dispatch(var) %}

{{ var.id|unquote }}

{% if var.__class__.__name__ == "GridType" %} {{ attributes(var.attributes) }}
{% for name in var.maps %}
{% endfor %}
{% elif var.__class__.__name__ == "BaseType" %} {{ attributes(var.attributes) }} {% if var.shape %}
{% for shp in var.shape %} {% if shp > 0 %} {% else %} {% endif %} {% endfor %}
{% endif %} {% elif var.__class__.__name__ == "SequenceType" %} {{ attributes(var.attributes) }}
Filter where
{% for child in var.children() %} {{ dispatch(child) }} {% endfor %} {% else %} {{ attributes(var.attributes) }}
{% for child in var.children() %} {{ dispatch(child) }} {% endfor %}
{% endif %} {% endmacro %} {% macro attributes(d) %}
{% for k, v in d.items() %}
{{ k }}
{% if v is mapping %}
{{ attributes(v) }}
{% elif v is sequence and not v is string %}
{{ v|join(", ") }}
{% else %}
{{ v }}
{% endif %} {% endfor %}
{% endmacro %}