xgettext: Recognize ECMAScript-262 6th edition template literals.
Reported by Philip Chimento <philip.chimento@gmail.com>
in <https://savannah.gnu.org/bugs/index.php?50920>.
* gettext-tools/src/x-javascript.c (P7_TEMPLATE_START_OF_EXPRESSION): New macro.
(enum token_type_ty): Add token_type_template, token_type_ltemplate,
token_type_mtemplate, token_type_rtemplate.
(free_token): Treat token_type_template like token_type_string.
(phase7_getuc): Add support for backquote quote_char.
(brace_depth, template_literal_depth): New variables.
(phase5_get): Parse template literals.
(x_javascript_lex): Treat token_type_template like token_type_string. Handle the
combination of symbol followed by template.
(extract_balanced): Treat token_type_template like token_type_string, and
token_type_ltemplate, token_type_mtemplate, token_type_rtemplate like
token_type_other.
(extract_javascript): Initialize brace_depth, template_literal_depth.
* gettext-tools/tests/xgettext-javascript-7: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* gettext-tools/doc/gettext.texi (JavaScript): Mention the template literal
syntax for strings.
* NEWS: Mention the improvement.