Commit 5e469f4f authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Use HRESULTs instead of IDSs in parser.

parent 7774a0a4
......@@ -99,7 +99,7 @@ static const struct {
static int lex_error(parser_ctx_t *ctx, HRESULT hres)
{
ctx->hres = MAKE_JSERROR(hres);
ctx->hres = hres;
ctx->lexer_error = TRUE;
return -1;
}
......@@ -346,7 +346,7 @@ static int parse_string_literal(parser_ctx_t *ctx, const WCHAR **ret, WCHAR endc
}
if(ctx->ptr == ctx->end)
return lex_error(ctx, IDS_UNTERMINATED_STR);
return lex_error(ctx, JS_E_UNTERMINATED_STRING);
len = ctx->ptr-ptr;
......
......@@ -496,7 +496,7 @@ Expression_opt
Expression_err
: Expression { $$ = $1; }
| error { set_error(ctx, IDS_SYNTAX_ERROR); YYABORT; }
| error { set_error(ctx, JS_E_SYNTAX); YYABORT; }
/* ECMA-262 3rd Edition 11.14 */
Expression
......@@ -818,15 +818,15 @@ semicolon_opt
left_bracket
: '('
| error { set_error(ctx, IDS_LBRACKET); YYABORT; }
| error { set_error(ctx, JS_E_MISSING_LBRACKET); YYABORT; }
right_bracket
: ')'
| error { set_error(ctx, IDS_RBRACKET); YYABORT; }
| error { set_error(ctx, JS_E_MISSING_RBRACKET); YYABORT; }
semicolon
: ';'
| error { set_error(ctx, IDS_SEMICOLON); YYABORT; }
| error { set_error(ctx, JS_E_MISSING_SEMICOLON); YYABORT; }
%%
......@@ -1459,14 +1459,14 @@ static int parser_error(const char *str)
static void set_error(parser_ctx_t *ctx, UINT error)
{
ctx->hres = MAKE_JSERROR(error);
ctx->hres = error;
}
static BOOL explicit_error(parser_ctx_t *ctx, void *obj, WCHAR next)
{
if(obj || *(ctx->ptr-1)==next) return TRUE;
set_error(ctx, IDS_SYNTAX_ERROR);
set_error(ctx, JS_E_SYNTAX);
return FALSE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment