File tree 2 files changed +14
-5
lines changed
2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -46,11 +46,15 @@ do*: func [
46
46
; Currently, load of URL has no special block forms.
47
47
48
48
; Load the data, first so it will error before change-dir
49
- data: load/header/as value 'unbound ; unbound so DO-NEEDS runs before INTERN
50
- ; Get the header and advance 'data to the code position
51
- hdr: first+ data ; object or none
52
- ; data is a block! here, with the header object in the first position back
53
- mod?: 'module = select hdr 'type
49
+ either string? value [
50
+ data: load/all/as value 'unbound ; does not evaluate REBOL header
51
+ ][
52
+ data: load/header/as value 'unbound ; unbound so DO-NEEDS runs before INTERN
53
+ ; Get the header and advance 'data to the code position
54
+ hdr: first+ data ; object or none
55
+ ; data is a block! here, with the header object in the first position back
56
+ mod?: 'module = select hdr 'type
57
+ ]
54
58
55
59
either all [string? value not mod?] [
56
60
; Return result without script overhead
Original file line number Diff line number Diff line change @@ -90,6 +90,11 @@ Rebol [
90
90
;@@ https://github.com/Oldes/Rebol-issues/issues/903
91
91
--assert all [error? e: try [do "<> 0" ] e/id = 'missing-arg]
92
92
--assert all [error? e: try [do next [1 <> 0 ]] e/id = 'missing-arg]
93
+
94
+ --test-- "do string with Rebol header"
95
+ ;@@ https://github.com/Oldes/Rebol-issues/issues/2596
96
+ --assert "Rebol []" == do "{Rebol []}"
97
+ --assert "^/ Rebol []" == try [do "{^/ Rebol []}" ]
93
98
94
99
===end-group===
95
100
You can’t perform that action at this time.
0 commit comments