// WARNING: This file was auto-generated by: {{ script }}
{%- macro make_symbols(tests_group, map_suffix, mode, local) -%}
xkb_symbols "{{ tests_group.name }}{{ map_suffix }}{{ "-" + mode if local else "" }}" {
	{% if local %}
	include "{{ filename }}({{ tests_group.name }}base)"
	{% endif %}
	{% for entry in tests_group.tests %}
	{% if is_not_comment(entry) %}
	{% if debug and not local and mode == "update" %}

	// base:     {{ "".join(entry.base.xkb) or "(empty)" }}
	// key to merge / replace result
	{% endif %}
	{{ mode + " " if local and mode != "default" else "" -}}
	key {{ entry.key.xkb }} { {{ "".join(entry["update" if local else mode].xkb) }} };
	{% if debug and not local and mode == "update" %}
	// override: {{ "".join(entry.override.xkb) or "(empty)" }}
	// augment:  {{ "".join(entry.augment.xkb) or "(empty)" }}
	{% endif %}
	{% else %}

	////// {{ entry }} //////
	{% endif %}
	{% endfor %}
};
{%- endmacro %}
{% for tests_group in tests_groups %}

xkb_symbols "{{ tests_group.name }}base" {
	{% for entry in tests_group.tests|select("is_not_comment") %}
	key {{ entry.key.xkb }} { {{ "".join(entry.base.xkb) }} };
	{% endfor %}
};

{{ make_symbols(tests_group, "new", "update", false) }}

{{ make_symbols(tests_group, "new", "default", true) }}

{{ make_symbols(tests_group, "new", "augment", true) }}

{{ make_symbols(tests_group, "new", "override", true) }}

{{ make_symbols(tests_group, "new", "replace", true) }}

{{ make_symbols(tests_group, "augment", "augment", false) }}

{{ make_symbols(tests_group, "override", "override", false) }}
{% endfor %}
{% for g in range(extra_groups) %}

xkb_symbols "group{{ g + 2 }}" {
	{% for key in keycodes %}
	key {{ key.xkb }} { [{{ alt_keysyms(g) | join(", ") }}] };
	{% endfor %}
};
{% endfor %}
