vbscript: Added lexer support for newlines and comments.

This commit is contained in:
Jacek Caban 2011-09-07 14:07:54 +02:00 committed by Alexandre Julliard
parent c03cecab39
commit 9f8492692c
2 changed files with 18 additions and 2 deletions

View File

@ -36,8 +36,23 @@ static int parse_next_token(void *lval, parser_ctx_t *ctx)
return ctx->last_token == tNL ? tEOF : tNL;
c = *ctx->ptr;
FIXME("Unhandled char %c in %s\n", *ctx->ptr, debugstr_w(ctx->ptr));
return c;
switch(c) {
case '\n':
ctx->ptr++;
return tNL;
case '\'':
ctx->ptr = strchrW(ctx->ptr, '\n');
if(ctx->ptr)
ctx->ptr++;
else
ctx->ptr = ctx->end;
return tNL;
default:
FIXME("Unhandled char %c in %s\n", *ctx->ptr, debugstr_w(ctx->ptr));
}
return 0;
}
int parser_lex(void *lval, parser_ctx_t *ctx)

View File

@ -462,6 +462,7 @@ static void run_tests(void)
strict_dispid_check = TRUE;
parse_script_a("");
parse_script_a("' empty ;");
}
static BOOL check_vbscript(void)