Commit 77d0c2a4 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Moved skipping spaces to separated function.

parent 79dc3bc7
......@@ -231,6 +231,16 @@ static BOOL skip_comment(parser_ctx_t *ctx)
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)
{
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)
{
do {
while(ctx->ptr < ctx->end && isspaceW(*ctx->ptr)) {
if(is_endline(*ctx->ptr++))
ctx->nl = TRUE;
}
if(ctx->ptr == ctx->end)
if(!skip_spaces(ctx))
return tEOF;
}while(skip_comment(ctx) || skip_html_comment(ctx));
......
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