Skip to content

Commit

Permalink
CHANGE: debug print function ?? not throwing an error on invalid paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Aug 31, 2023
1 parent f4dd931 commit 2f79983
Showing 1 changed file with 10 additions and 22 deletions.
32 changes: 10 additions & 22 deletions src/mezz/base-debug.reb
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,18 @@ probe: func [
{Debug print a word, path, or block of such, followed by its molded value.}
'name "Word, path or block to obtain values."
][
case [
any [
word? :name
path? :name
unless block? name [name: reduce [name]]
foreach word name [
either any [
word? :word
path? :word
][
prin ajoin ["^[[1;32m" mold :name "^[[0m: ^[[32m"]
prin either value? :name [mold/all get/any :name] ["#[unset!]"]
print "^[[0m"
]
block? :name [
foreach word name [
either any [
word? :word
path? :word
][
prin ajoin ["^[[1;32m" mold :word "^[[0m: ^[[32m"]
prin either value? :word [mold/all get/any :word]["#[unset!]"]
print "^[[0m"
][
print ajoin ["^[[1;32m" mold/all word "^[[0m"]
]
]
prin ajoin ["^[[1;32m" mold :word "^[[0m: ^[[32m"]
prin try/with [mold/all get/any :word][["^[[1;35mError:" system/state/last-error/id]]
print "^[[0m"
][
print ajoin ["^[[1;32m" mold/all word "^[[0m"]
]
true [print ajoin ["^[[1;32m" mold/all :name "^[[0m"]]
]
exit
]

0 comments on commit 2f79983

Please sign in to comment.