allow nested dictionaries in dict_to_lua
This commit is contained in:
parent
91655a855d
commit
20729242f9
|
@ -1,7 +1,7 @@
|
||||||
{% macro dict_to_lua(dict) -%}
|
{% macro dict_to_lua(dict) -%}
|
||||||
{
|
{
|
||||||
{%- for key, value in dict.items() -%}
|
{%- for key, value in dict.items() -%}
|
||||||
["{{ key }}"] = {{ value | safe }}{% if not loop.last %},{% endif %}
|
["{{ key }}"] = {% if value is mapping %}{{ dict_to_lua(value) }}{% else %}{{ value | safe }}{% endif %}{% if not loop.last %},{% endif %}
|
||||||
{% endfor -%}
|
{% endfor -%}
|
||||||
}
|
}
|
||||||
{%- endmacro %}
|
{%- endmacro %}
|
||||||
|
|
Loading…
Reference in New Issue