Jacek Caban : vbscript: Added lexer support for newlines and comments.

Alexandre Julliard julliard at winehq.org
Wed Sep 7 12:35:30 CDT 2011


Module: wine
Branch: master
Commit: 9f8492692c1b241e3b55d6bb0cab8edbdc1b29c4
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9f8492692c1b241e3b55d6bb0cab8edbdc1b29c4

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Sep  7 14:07:54 2011 +0200

vbscript: Added lexer support for newlines and comments.

---

 dlls/vbscript/lex.c       |   19 +++++++++++++++++--
 dlls/vbscript/tests/run.c |    1 +
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/dlls/vbscript/lex.c b/dlls/vbscript/lex.c
index 0e7ecce..f3dc8ee 100644
--- a/dlls/vbscript/lex.c
+++ b/dlls/vbscript/lex.c
@@ -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)
diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c
index 6ccd466..d61b81f 100644
--- a/dlls/vbscript/tests/run.c
+++ b/dlls/vbscript/tests/run.c
@@ -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)




More information about the wine-cvs mailing list