jscript: Fixed keywords handling.
diff --git a/dlls/jscript/lex.c b/dlls/jscript/lex.c
index eb9b835..1b33737 100644
--- a/dlls/jscript/lex.c
+++ b/dlls/jscript/lex.c
@@ -105,6 +105,12 @@
return -1;
}
+/* ECMA-262 3rd Edition 7.6 */
+static BOOL is_identifier_char(WCHAR c)
+{
+ return isalnumW(c) || c == '$' || c == '_' || c == '\\';
+}
+
static int check_keyword(parser_ctx_t *ctx, const WCHAR *word, const WCHAR **lval)
{
const WCHAR *p1 = ctx->ptr;
@@ -117,7 +123,7 @@
p2++;
}
- if(*p2 || (p1 < ctx->end && isalnumW(*p1)))
+ if(*p2 || (p1 < ctx->end && is_identifier_char(*p1)))
return 1;
*lval = ctx->ptr;
@@ -131,11 +137,6 @@
return c == '\n' || c == '\r' || c == 0x2028 || c == 0x2029;
}
-static BOOL is_identifier_char(WCHAR c)
-{
- return isalnumW(c) || c == '$' || c == '_' || c == '\\';
-}
-
static int hex_to_int(WCHAR c)
{
if('0' <= c && c <= '9')