Skip to content

Commit 44b13f8

Browse files
committed
FIX/CHANGE: allow any value as a part of path!
``` >> p: to-path b: [1 #[none] #[true] [] () #{}] == 1/none/true/[]/()/#{} ``` related to: Oldes/Rebol-issues#477
1 parent 0ad97ba commit 44b13f8

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/core/t-block.c

+4
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,14 @@
4747
return (num > 0);
4848
}
4949

50+
#ifdef not_used
5051
static void No_Nones_Or_Logic(REBVAL *arg) {
5152
arg = VAL_BLK_DATA(arg);
5253
for (; NOT_END(arg); arg++) {
5354
if (IS_NONE(arg) || IS_LOGIC(arg)) Trap_Arg(arg);
5455
}
5556
}
57+
#endif
5658

5759
/***********************************************************************
5860
**
@@ -288,8 +290,10 @@ static void No_Nones_Or_Logic(REBVAL *arg) {
288290
// make block! [1 2 3]
289291
if (ANY_BLOCK(arg)) {
290292
len = VAL_BLK_LEN(arg);
293+
#ifdef not_used
291294
if (len > 0 && type >= REB_PATH && type <= REB_LIT_PATH)
292295
No_Nones_Or_Logic(arg);
296+
#endif
293297
ser = Copy_Values(VAL_BLK_DATA(arg), len);
294298
goto done;
295299
}

src/tests/units/series-test.r3

+8-3
Original file line numberDiff line numberDiff line change
@@ -654,9 +654,14 @@ Rebol [
654654
--assert (mold to-path [1 2 3]) = "1/2/3"
655655
--assert (mold to-path [1 none 3]) = "1/none/3"
656656
;@@ https://github.com/Oldes/Rebol-issues/issues/477
657-
--assert error? try [to-path [1 #[none] 3]]
658-
--assert error? try [to-path [1 #[true] 3]]
659-
--assert error? try [to-path [1 #[false] 3]]
657+
--assert path? p: try [to-path b: [1 #[none] #[true] [] () #{}]]
658+
--assert integer? p/1
659+
--assert none? p/2
660+
--assert true? p/3
661+
--assert block? p/4
662+
--assert paren? p/5
663+
--assert binary? p/6
664+
--assert b = to-block p
660665

661666
===end-group===
662667

0 commit comments

Comments
 (0)