runtime errors should return strings, not buffers

This commit is contained in:
Scott Richmond 2024-06-07 16:41:11 -04:00
parent 1fff319bb6
commit 533a40bd45

View File

@ -24,13 +24,13 @@
(set (out :errors) (scanned :errors))
(each err (scanned :errors)
(e/scan-error err))
(break (j/encode out)))
(break (-> out j/encode string)))
(def parsed (p/parse scanned))
(when (any? (parsed :errors))
(set (out :errors) (parsed :errors))
(each err (parsed :errors)
(e/parse-error err))
(break (j/encode out)))
(break (-> out j/encode string)))
(def validated (v/valid parsed ctx))
(when (any? (validated :errors))
(set (out :errors) (validated :errors))
@ -43,7 +43,7 @@
([err]
(e/runtime-error err)
(set (out :errors) [err])
(break (j/encode out))))
(break (-> out j/encode string))))
(setdyn :out stdout)
(set (out :result) (b/show result))
(var post @{})
@ -51,9 +51,9 @@
(set post (i/interpret prelude/post/ast ctx))
([err] (e/runtime-error err)))
(set (out :draw) (post :draw))
(string (j/encode out)))
(-> out j/encode string))
(-> (ludus `
random (1, 3)
`) j/decode)
(ludus `
let foo = 42
"{foo} bar baz"
`)