{% macro dispatch(var) %} {% if var.__class__.__name__ == "GridType" %} {{ attributes(var.attributes) }}
{% elif var.__class__.__name__ == "BaseType" %} {{ attributes(var.attributes) }} {% if var.shape %} {% endif %} {% elif var.__class__.__name__ == "SequenceType" %} {{ attributes(var.attributes) }} {% for child in var.children() %} {{ dispatch(child) }} {% endfor %} {% else %} {{ attributes(var.attributes) }} {% endif %} {% endmacro %} {% macro attributes(d) %}