Commit 9f849269 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

vbscript: Added lexer support for newlines and comments.

parent c03cecab
...@@ -36,8 +36,23 @@ static int parse_next_token(void *lval, parser_ctx_t *ctx) ...@@ -36,8 +36,23 @@ static int parse_next_token(void *lval, parser_ctx_t *ctx)
return ctx->last_token == tNL ? tEOF : tNL; return ctx->last_token == tNL ? tEOF : tNL;
c = *ctx->ptr; 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) int parser_lex(void *lval, parser_ctx_t *ctx)
......
...@@ -462,6 +462,7 @@ static void run_tests(void) ...@@ -462,6 +462,7 @@ static void run_tests(void)
strict_dispid_check = TRUE; strict_dispid_check = TRUE;
parse_script_a(""); parse_script_a("");
parse_script_a("' empty ;");
} }
static BOOL check_vbscript(void) static BOOL check_vbscript(void)
......
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