xgettext: JavaScript: Recognize template literals inside JSX.
Reported by whiteinge <gnu-savannah@eseth.com>
at <https://savannah.gnu.org/bugs/?58407>
and by tuberry and Gianni Lerro <glerro@pm.me>
at <https://savannah.gnu.org/bugs/?62203>.
* gettext-tools/src/x-javascript.c (enum level_ty): New enum.
(levels, levels_alloc, level): New variables.
(new_level): New function.
(level_type): New macro.
(template_literal_depth, brace_depths, brace_depths_alloc): Remove variables.
(new_brace_depth_level): Remove function.
(xml_element_depth, inside_embedded_js_in_xml): Remove variables.
(phase5_get): Use the levels stack instead of the separate stack for braces and
XML.
(extract_javascript): Update.
* gettext-tools/tests/xgettext-javascript-6: Add test cases that mix JSX with
template literals.