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
39058487
Commit
39058487
authored
Nov 30, 2022
by
Robert Wilhelm
Committed by
Alexandre Julliard
Nov 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Handle "case" statements without separators.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53678
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
4979ae5a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
4 deletions
+27
-4
parser.y
dlls/vbscript/parser.y
+7
-4
lang.vbs
dlls/vbscript/tests/lang.vbs
+20
-0
No files found.
dlls/vbscript/parser.y
View file @
39058487
...
...
@@ -323,10 +323,9 @@ Else_opt
| tELSE StatementsNl_opt { $$ = $2; }
CaseClausules
: /* empty */ { $$ = NULL; }
| tCASE tELSE StSep StatementsNl_opt { $$ = new_case_clausule(ctx, NULL, $4, NULL); }
| tCASE ExpressionList StSep StatementsNl_opt CaseClausules
{ $$ = new_case_clausule(ctx, $2, $4, $5); }
: /* empty */ { $$ = NULL; }
| tCASE tELSE StSep_opt StatementsNl_opt { $$ = new_case_clausule(ctx, NULL, $4, NULL); }
| tCASE ExpressionList StSep_opt StatementsNl_opt CaseClausules { $$ = new_case_clausule(ctx, $2, $4, $5); }
Arguments
: tEMPTYBRACKETS { $$ = NULL; }
...
...
@@ -513,6 +512,10 @@ Identifier
| tPROPERTY { ctx->last_token = tIdentifier; $$ = $1; }
| tSTEP { ctx->last_token = tIdentifier; $$ = $1; }
StSep_opt
: /* empty */
| StSep
/* Most statements accept both new line and ':' as separators */
StSep
: tNL
...
...
dlls/vbscript/tests/lang.vbs
View file @
39058487
...
...
@@ -766,6 +766,26 @@ end select
select
case
0
:
case
1
:
case
else
:
end
select
' Case without separator
function
SelectCaseTest
(
x
)
select
case
x
case
0
:
SelectCaseTest
=
100
case
1
SelectCaseTest
=
200
case
2
SelectCaseTest
=
300
case
3
case
4
SelectCaseTest
=
400
case
else
SelectCaseTest
=
500
end
select
end
function
call
ok
(
SelectCaseTest
(
0
)
=
100
,
"Unexpected case "
&
SelectCaseTest
(
0
))
call
ok
(
SelectCaseTest
(
1
)
=
200
,
"Unexpected case "
&
SelectCaseTest
(
1
))
call
ok
(
SelectCaseTest
(
2
)
=
300
,
"Unexpected case "
&
SelectCaseTest
(
2
))
call
ok
(
SelectCaseTest
(
3
)
=
vbEmpty
,
"Unexpected case "
&
SelectCaseTest
(
3
))
call
ok
(
SelectCaseTest
(
4
)
=
400
,
"Unexpected case "
&
SelectCaseTest
(
4
))
call
ok
(
SelectCaseTest
(
5
)
=
500
,
"Unexpected case "
&
SelectCaseTest
(
5
))
if
false
then
Sub
testsub
x
=
true
...
...
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