jscript: Use HRESULTs instead of IDSs in parser.

This commit is contained in:
Jacek Caban 2010-12-28 15:05:13 +01:00 committed by Alexandre Julliard
parent 7774a0a4c1
commit 5e469f4fff
2 changed files with 8 additions and 8 deletions

View File

@ -99,7 +99,7 @@ static const struct {
static int lex_error(parser_ctx_t *ctx, HRESULT hres) static int lex_error(parser_ctx_t *ctx, HRESULT hres)
{ {
ctx->hres = MAKE_JSERROR(hres); ctx->hres = hres;
ctx->lexer_error = TRUE; ctx->lexer_error = TRUE;
return -1; 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) if(ctx->ptr == ctx->end)
return lex_error(ctx, IDS_UNTERMINATED_STR); return lex_error(ctx, JS_E_UNTERMINATED_STRING);
len = ctx->ptr-ptr; len = ctx->ptr-ptr;

View File

@ -496,7 +496,7 @@ Expression_opt
Expression_err Expression_err
: Expression { $$ = $1; } : Expression { $$ = $1; }
| error { set_error(ctx, IDS_SYNTAX_ERROR); YYABORT; } | error { set_error(ctx, JS_E_SYNTAX); YYABORT; }
/* ECMA-262 3rd Edition 11.14 */ /* ECMA-262 3rd Edition 11.14 */
Expression Expression
@ -818,15 +818,15 @@ semicolon_opt
left_bracket left_bracket
: '(' : '('
| error { set_error(ctx, IDS_LBRACKET); YYABORT; } | error { set_error(ctx, JS_E_MISSING_LBRACKET); YYABORT; }
right_bracket right_bracket
: ')' : ')'
| error { set_error(ctx, IDS_RBRACKET); YYABORT; } | error { set_error(ctx, JS_E_MISSING_RBRACKET); YYABORT; }
semicolon 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) 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) static BOOL explicit_error(parser_ctx_t *ctx, void *obj, WCHAR next)
{ {
if(obj || *(ctx->ptr-1)==next) return TRUE; if(obj || *(ctx->ptr-1)==next) return TRUE;
set_error(ctx, IDS_SYNTAX_ERROR); set_error(ctx, JS_E_SYNTAX);
return FALSE; return FALSE;
} }