jscript: Moved skipping spaces to separated function.

This commit is contained in:
Jacek Caban 2014-09-30 16:51:44 +02:00 committed by Alexandre Julliard
parent 79dc3bc72e
commit 77d0c2a44c
1 changed files with 11 additions and 5 deletions

View File

@ -231,6 +231,16 @@ static BOOL skip_comment(parser_ctx_t *ctx)
return TRUE; return TRUE;
} }
static BOOL skip_spaces(parser_ctx_t *ctx)
{
while(ctx->ptr < ctx->end && isspaceW(*ctx->ptr)) {
if(is_endline(*ctx->ptr++))
ctx->nl = TRUE;
}
return ctx->ptr != ctx->end;
}
static BOOL unescape(WCHAR *str) static BOOL unescape(WCHAR *str)
{ {
WCHAR *pd, *p, c; WCHAR *pd, *p, c;
@ -534,11 +544,7 @@ static BOOL parse_numeric_literal(parser_ctx_t *ctx, double *ret)
static int next_token(parser_ctx_t *ctx, void *lval) static int next_token(parser_ctx_t *ctx, void *lval)
{ {
do { do {
while(ctx->ptr < ctx->end && isspaceW(*ctx->ptr)) { if(!skip_spaces(ctx))
if(is_endline(*ctx->ptr++))
ctx->nl = TRUE;
}
if(ctx->ptr == ctx->end)
return tEOF; return tEOF;
}while(skip_comment(ctx) || skip_html_comment(ctx)); }while(skip_comment(ctx) || skip_html_comment(ctx));