File tree 2 files changed +6
-0
lines changed
2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -489,6 +489,7 @@ skip_hidden: ;
489
489
if (mode == LM_REMOVE ) {
490
490
// Remove hole (updates tail):
491
491
if (windex < index ) Remove_Series (series , windex , index - windex );
492
+ if (err == 2 ) return R_TOS1 ; // If BREAK/RETURN
492
493
if (return_count ) {
493
494
index -= windex ;
494
495
SET_INTEGER (DS_RETURN , IS_MAP (value ) ? index / 2 : index );
Original file line number Diff line number Diff line change @@ -984,6 +984,11 @@ Rebol [
984
984
--assert s = [2 3 4 ]
985
985
--assert 1 = remove-each /count n s: [1 2 3 4 ] [if n = 2 [break] true]
986
986
--assert s = [2 3 4 ]
987
+ --test-- "break/return in remove-each"
988
+ --assert 'x = remove-each n s: [1 2 3 4 ] [if n = 2 [break /return 'x] true]
989
+ --assert s = [2 3 4 ]
990
+ --assert 'x = remove-each /count n s: [1 2 3 4 ] [if n = 2 [break /return 'x] true]
991
+ --assert s = [2 3 4 ]
987
992
988
993
===end-group===
989
994
You can’t perform that action at this time.
0 commit comments