Commit 17c5a250 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

vbscript: Support unary + expressions.

parent 9b18772c
...@@ -366,6 +366,7 @@ UnaryExpression ...@@ -366,6 +366,7 @@ UnaryExpression
| CallExpression { $$ = $1; } | CallExpression { $$ = $1; }
| tNEW Identifier { $$ = new_new_expression(ctx, $2); CHECK_ERROR; } | tNEW Identifier { $$ = new_new_expression(ctx, $2); CHECK_ERROR; }
| '-' UnaryExpression { $$ = new_unary_expression(ctx, EXPR_NEG, $2); CHECK_ERROR; } | '-' UnaryExpression { $$ = new_unary_expression(ctx, EXPR_NEG, $2); CHECK_ERROR; }
| '+' UnaryExpression { $$ = $2; }
CallExpression CallExpression
: PrimaryExpression { $$ = $1; } : PrimaryExpression { $$ = $1; }
......
...@@ -1093,6 +1093,14 @@ Call ok(getVT(cs) = "VT_BSTR", "getVT(cs) = " & getVT(cs)) ...@@ -1093,6 +1093,14 @@ Call ok(getVT(cs) = "VT_BSTR", "getVT(cs) = " & getVT(cs))
Call ok(isNull(cnull), "cnull = " & cnull) Call ok(isNull(cnull), "cnull = " & cnull)
Call ok(getVT(cnull) = "VT_NULL", "getVT(cnull) = " & getVT(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" if false then Const conststr = "str"
Call ok(conststr = "str", "conststr = " & conststr) Call ok(conststr = "str", "conststr = " & conststr)
Call ok(getVT(conststr) = "VT_BSTR", "getVT(conststr) = " & getVT(conststr)) Call ok(getVT(conststr) = "VT_BSTR", "getVT(conststr) = " & getVT(conststr))
......
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