vbscript: Added lexer support for newlines and comments.
This commit is contained in:
parent
c03cecab39
commit
9f8492692c
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue