Module: wine Branch: master Commit: 64fd6fa7872059379e0eb42392a9fe5f65487e2d URL: http://source.winehq.org/git/wine.git/?a=commit;h=64fd6fa7872059379e0eb42392...
Author: Jacek Caban jacek@codeweavers.com Date: Mon Oct 17 14:32:13 2011 +0200
vbscript: Added lexer support for '_'.
---
dlls/vbscript/lex.c | 10 ++++++++++ dlls/vbscript/tests/lang.vbs | 7 +++++++ dlls/vbscript/tests/run.c | 2 ++ 3 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/dlls/vbscript/lex.c b/dlls/vbscript/lex.c index ac3d65e..08ab375 100644 --- a/dlls/vbscript/lex.c +++ b/dlls/vbscript/lex.c @@ -354,6 +354,7 @@ static int parse_next_token(void *lval, parser_ctx_t *ctx) case '^': case '\': case '.': + case '_': return *ctx->ptr++; case '(': /* NOTE: @@ -402,6 +403,15 @@ int parser_lex(void *lval, parser_ctx_t *ctx)
while(1) { ret = parse_next_token(lval, ctx); + if(ret == '_') { + skip_spaces(ctx); + if(*ctx->ptr != '\n') { + FIXME("'_' not followed by newline\n"); + return 0; + } + ctx->ptr++; + continue; + } if(ret != tNL || ctx->last_token != tNL) break;
diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index 46a0330..de72338 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -177,6 +177,13 @@ Call ok(2^3^2 = 64, "2^3^2 = " & (2^3^2)) Call ok(-3^2 = 9, "-3^2 = " & (-3^2)) Call ok(2*3^2 = 18, "2*3^2 = " & (2*3^2))
+x =_ + 3 +x _ + = 3 + +x = 3 + if true then y = true : x = y ok x, "x is false"
diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c index 367ffea..9fa4240 100644 --- a/dlls/vbscript/tests/run.c +++ b/dlls/vbscript/tests/run.c @@ -1226,6 +1226,8 @@ static void run_tests(void)
parse_script_a("x = 1\n Call ok(x = 1, "x = " & x)");
+ parse_script_a("x = _ \n3"); + test_global_vars_ref(TRUE); test_global_vars_ref(FALSE);