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
00dfcb08
Commit
00dfcb08
authored
Jul 03, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 09, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added support for exit for statement in 'for in' loops.
parent
f8deed7c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
compile.c
dlls/vbscript/compile.c
+6
-5
lang.vbs
dlls/vbscript/tests/lang.vbs
+9
-0
No files found.
dlls/vbscript/compile.c
View file @
00dfcb08
...
@@ -650,7 +650,8 @@ static HRESULT compile_dowhile_statement(compile_ctx_t *ctx, while_statement_t *
...
@@ -650,7 +650,8 @@ static HRESULT compile_dowhile_statement(compile_ctx_t *ctx, while_statement_t *
static
HRESULT
compile_foreach_statement
(
compile_ctx_t
*
ctx
,
foreach_statement_t
*
stat
)
static
HRESULT
compile_foreach_statement
(
compile_ctx_t
*
ctx
,
foreach_statement_t
*
stat
)
{
{
unsigned
loop_start
,
loop_end
;
statement_ctx_t
loop_ctx
=
{
1
};
unsigned
loop_start
;
HRESULT
hres
;
HRESULT
hres
;
hres
=
compile_expression
(
ctx
,
stat
->
group_expr
);
hres
=
compile_expression
(
ctx
,
stat
->
group_expr
);
...
@@ -661,14 +662,14 @@ static HRESULT compile_foreach_statement(compile_ctx_t *ctx, foreach_statement_t
...
@@ -661,14 +662,14 @@ static HRESULT compile_foreach_statement(compile_ctx_t *ctx, foreach_statement_t
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
loop_start
=
ctx
->
instr_cnt
;
loop_start
=
ctx
->
instr_cnt
;
if
(
!
(
loop_
end
=
alloc_label
(
ctx
)))
if
(
!
(
loop_
ctx
.
for_end_label
=
alloc_label
(
ctx
)))
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
hres
=
push_instr_uint_bstr
(
ctx
,
OP_enumnext
,
loop_
end
,
stat
->
identifier
);
hres
=
push_instr_uint_bstr
(
ctx
,
OP_enumnext
,
loop_
ctx
.
for_end_label
,
stat
->
identifier
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
return
hres
;
return
hres
;
hres
=
compile_statement
(
ctx
,
NULL
,
stat
->
body
);
hres
=
compile_statement
(
ctx
,
&
loop_ctx
,
stat
->
body
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
return
hres
;
return
hres
;
...
@@ -676,7 +677,7 @@ static HRESULT compile_foreach_statement(compile_ctx_t *ctx, foreach_statement_t
...
@@ -676,7 +677,7 @@ static HRESULT compile_foreach_statement(compile_ctx_t *ctx, foreach_statement_t
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
return
hres
;
return
hres
;
label_set_addr
(
ctx
,
loop_
end
);
label_set_addr
(
ctx
,
loop_
ctx
.
for_end_label
);
return
S_OK
;
return
S_OK
;
}
}
...
...
dlls/vbscript/tests/lang.vbs
View file @
00dfcb08
...
@@ -431,6 +431,15 @@ next
...
@@ -431,6 +431,15 @@ next
Call
ok
(
y
=
3
,
"y = "
&
y
)
Call
ok
(
y
=
3
,
"y = "
&
y
)
Call
ok
(
getVT
(
x
)
=
"VT_EMPTY*"
,
"getVT(x) = "
&
getVT
(
x
))
Call
ok
(
getVT
(
x
)
=
"VT_EMPTY*"
,
"getVT(x) = "
&
getVT
(
x
))
Call
collectionObj
.
reset
()
y
=
false
for
each
x
in
collectionObj
if
x
=
2
then
exit
for
y
=
1
next
Call
ok
(
y
=
1
,
"y = "
&
y
)
Call
ok
(
x
=
2
,
"x = "
&
x
)
if
false
then
if
false
then
Sub
testsub
Sub
testsub
x
=
true
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