Jacek Caban : vbscript: Support unary + expressions.
Alexandre Julliard
julliard at winehq.org
Thu Aug 22 15:09:54 CDT 2019
Module: wine
Branch: master
Commit: 17c5a25091dba697fff2b02e1ac34c48124c8485
URL: https://source.winehq.org/git/wine.git/?a=commit;h=17c5a25091dba697fff2b02e1ac34c48124c8485
Author: Jacek Caban <jacek at codeweavers.com>
Date: Thu Aug 22 19:31:55 2019 +0200
vbscript: Support unary + expressions.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/vbscript/parser.y | 1 +
dlls/vbscript/tests/lang.vbs | 8 ++++++++
2 files changed, 9 insertions(+)
diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y
index 4c8c6e3..11a8f9d 100644
--- a/dlls/vbscript/parser.y
+++ b/dlls/vbscript/parser.y
@@ -366,6 +366,7 @@ UnaryExpression
| CallExpression { $$ = $1; }
| tNEW Identifier { $$ = new_new_expression(ctx, $2); CHECK_ERROR; }
| '-' UnaryExpression { $$ = new_unary_expression(ctx, EXPR_NEG, $2); CHECK_ERROR; }
+ | '+' UnaryExpression { $$ = $2; }
CallExpression
: PrimaryExpression { $$ = $1; }
diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs
index afd7c24..49c673a 100644
--- a/dlls/vbscript/tests/lang.vbs
+++ b/dlls/vbscript/tests/lang.vbs
@@ -1093,6 +1093,14 @@ Call ok(getVT(cs) = "VT_BSTR", "getVT(cs) = " & getVT(cs))
Call ok(isNull(cnull), "cnull = " & cnull)
Call ok(getVT(cnull) = "VT_NULL", "getVT(cnull) = " & getVT(cnull))
+Call ok(+1 = 1, "+1 != 1")
+Call ok(+true = true, "+1 != 1")
+Call ok(getVT(+true) = "VT_BOOL", "getVT(+true) = " & getVT(+true))
+Call ok(+"true" = "true", """+true"" != true")
+Call ok(getVT(+"true") = "VT_BSTR", "getVT(+""true"") = " & getVT(+"true"))
+Call ok(+obj is obj, "+obj != obj")
+Call ok(+--+-+1 = -1, "+--+-+1 != -1")
+
if false then Const conststr = "str"
Call ok(conststr = "str", "conststr = " & conststr)
Call ok(getVT(conststr) = "VT_BSTR", "getVT(conststr) = " & getVT(conststr))
More information about the wine-cvs
mailing list