Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
a41ba1c3
Commit
a41ba1c3
authored
Oct 29, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 29, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added support for negative constants.
parent
378e86fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
6 deletions
+25
-6
parser.y
dlls/vbscript/parser.y
+14
-5
lang.vbs
dlls/vbscript/tests/lang.vbs
+11
-1
No files found.
dlls/vbscript/parser.y
View file @
a41ba1c3
...
...
@@ -125,6 +125,7 @@ static const WCHAR propertyW[] = {'p','r','o','p','e','r','t','y',0};
%type <expression> Expression LiteralExpression PrimaryExpression EqualityExpression CallExpression
%type <expression> ConcatExpression AdditiveExpression ModExpression IntdivExpression MultiplicativeExpression ExpExpression
%type <expression> NotExpression UnaryExpression AndExpression OrExpression XorExpression EqvExpression
%type <expression> ConstExpression NumericLiteralExpression
%type <member> MemberExpression
%type <expression> Arguments_opt ArgumentList_opt Step_opt ExpressionList
%type <bool> OptionExplicit_opt DoType
...
...
@@ -218,7 +219,11 @@ ConstDeclList
| ConstDecl ',' ConstDeclList { $1->next = $3; $$ = $1; }
ConstDecl
: Identifier '=' LiteralExpression { $$ = new_const_decl(ctx, $1, $3); CHECK_ERROR; }
: Identifier '=' ConstExpression { $$ = new_const_decl(ctx, $1, $3); CHECK_ERROR; }
ConstExpression
: LiteralExpression { $$ = $1; }
| '-' NumericLiteralExpression { $$ = new_unary_expression(ctx, EXPR_NEG, $2); CHECK_ERROR; }
DoType
: tWHILE { $$ = TRUE; }
...
...
@@ -354,14 +359,18 @@ LiteralExpression
: tTRUE { $$ = new_bool_expression(ctx, VARIANT_TRUE); CHECK_ERROR; }
| tFALSE { $$ = new_bool_expression(ctx, VARIANT_FALSE); CHECK_ERROR; }
| tString { $$ = new_string_expression(ctx, $1); CHECK_ERROR; }
| tShort { $$ = new_long_expression(ctx, EXPR_USHORT, $1); CHECK_ERROR; }
| '0' { $$ = new_long_expression(ctx, EXPR_USHORT, 0); CHECK_ERROR; }
| tLong { $$ = new_long_expression(ctx, EXPR_ULONG, $1); CHECK_ERROR; }
| tDouble { $$ = new_double_expression(ctx, $1); CHECK_ERROR; }
| NumericLiteralExpression { $$ = $1; }
| tEMPTY { $$ = new_expression(ctx, EXPR_EMPTY, 0); CHECK_ERROR; }
| tNULL { $$ = new_expression(ctx, EXPR_NULL, 0); CHECK_ERROR; }
| tNOTHING { $$ = new_expression(ctx, EXPR_NOTHING, 0); CHECK_ERROR; }
NumericLiteralExpression
: tShort { $$ = new_long_expression(ctx, EXPR_USHORT, $1); CHECK_ERROR; }
| '0' { $$ = new_long_expression(ctx, EXPR_USHORT, 0); CHECK_ERROR; }
| tLong { $$ = new_long_expression(ctx, EXPR_ULONG, $1); CHECK_ERROR; }
| tDouble { $$ = new_double_expression(ctx, $1); CHECK_ERROR; }
PrimaryExpression
: '(' Expression ')' { $$ = new_unary_expression(ctx, EXPR_BRACKETS, $2); }
| tME { $$ = new_expression(ctx, EXPR_ME, 0); CHECK_ERROR; }
...
...
dlls/vbscript/tests/lang.vbs
View file @
a41ba1c3
...
...
@@ -912,9 +912,19 @@ Call obj.test(obj)
Call
ok
(
getVT
(
test
)
=
"VT_DISPATCH"
,
"getVT(test) = "
&
getVT
(
test
))
Call
ok
(
Me
is
Test
,
"Me is not Test"
)
Const
c1
=
1
,
c2
=
2
Const
c1
=
1
,
c2
=
2
,
c3
=
-
3
Call
ok
(
c1
=
1
,
"c1 = "
&
c1
)
Call
ok
(
getVT
(
c1
)
=
"VT_I2"
,
"getVT(c1) = "
&
getVT
(
c1
))
Call
ok
(
c3
=
-
3
,
"c3 = "
&
c3
)
Call
ok
(
getVT
(
c3
)
=
"VT_I2"
,
"getVT(c3) = "
&
getVT
(
c3
))
Const
cb
=
True
,
cs
=
"test"
,
cnull
=
null
Call
ok
(
cb
,
"cb = "
&
cb
)
Call
ok
(
getVT
(
cb
)
=
"VT_BOOL"
,
"getVT(cb) = "
&
getVT
(
cb
))
Call
ok
(
cs
=
"test"
,
"cs = "
&
cs
)
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
))
if
false
then
Const
conststr
=
"str"
Call
ok
(
conststr
=
"str"
,
"conststr = "
&
conststr
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment