Andreas Stricker <[email protected]> writes:
> --- a/gettext-tools/src/x-javascript.c
> +++ b/gettext-tools/src/x-javascript.c
> @@ -1009,7 +1009,7 @@ phase7_getuc (int quote_char, unsigned int
> *backslash_counter)
> case '\n':
> continue;
> case '\\':
> - ++*backslash_counter;
> + *backslash_counter = 0;
Thanks for looking into this. However, I doubt that backslash_counter
is even needed for JavaScript parser. The original code in the Python
parser has a check like this:
if (c == quote_char && (interpret_ansic || (*backslash_counter & 1) == 0))
In JavaScript parser, interpret_ansic is always true, and the latter
condition won't be checked (i.e. this seems to be a regression
introduced by my rewrite :)
By the way, ECMA 262 says:
* The CV of DoubleStringCharacter :: \ EscapeSequence is the CV of the
EscapeSequence.
* The CV of CharacterEscapeSequence :: NonEscapeCharacter is the CV of
the NonEscapeCharacter.
where CV stands for "character value". That means, "\xxx" should be
treated as "xxx", while the current implementation treats it as "\\xxx".
Regards,
--
Daiki Ueno