Skip to content

Commit 2f79983

Browse files
committed
CHANGE: debug print function ?? not throwing an error on invalid paths
resolves: Oldes/Rebol-issues#2565
1 parent f4dd931 commit 2f79983

File tree

1 file changed

+10
-22
lines changed

1 file changed

+10
-22
lines changed

src/mezz/base-debug.reb

+10-22
Original file line numberDiff line numberDiff line change
@@ -34,30 +34,18 @@ probe: func [
3434
{Debug print a word, path, or block of such, followed by its molded value.}
3535
'name "Word, path or block to obtain values."
3636
][
37-
case [
38-
any [
39-
word? :name
40-
path? :name
37+
unless block? name [name: reduce [name]]
38+
foreach word name [
39+
either any [
40+
word? :word
41+
path? :word
4142
][
42-
prin ajoin ["^[[1;32m" mold :name "^[[0m: ^[[32m"]
43-
prin either value? :name [mold/all get/any :name] ["#[unset!]"]
44-
print "^[[0m"
45-
]
46-
block? :name [
47-
foreach word name [
48-
either any [
49-
word? :word
50-
path? :word
51-
][
52-
prin ajoin ["^[[1;32m" mold :word "^[[0m: ^[[32m"]
53-
prin either value? :word [mold/all get/any :word]["#[unset!]"]
54-
print "^[[0m"
55-
][
56-
print ajoin ["^[[1;32m" mold/all word "^[[0m"]
57-
]
58-
]
43+
prin ajoin ["^[[1;32m" mold :word "^[[0m: ^[[32m"]
44+
prin try/with [mold/all get/any :word][["^[[1;35mError:" system/state/last-error/id]]
45+
print "^[[0m"
46+
][
47+
print ajoin ["^[[1;32m" mold/all word "^[[0m"]
5948
]
60-
true [print ajoin ["^[[1;32m" mold/all :name "^[[0m"]]
6149
]
6250
exit
6351
]

0 commit comments

Comments
 (0)