From ca238f9c89d3156842b0a3d5fe24a5d69b2eedb0 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 6 Apr 2018 08:32:41 -0400 Subject: - Adapted new-luxc's code to latest stdlib changes. --- new-luxc/source/luxc/io.jvm.lux | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'new-luxc/source/luxc/io.jvm.lux') diff --git a/new-luxc/source/luxc/io.jvm.lux b/new-luxc/source/luxc/io.jvm.lux index fdda1520c..482250f63 100644 --- a/new-luxc/source/luxc/io.jvm.lux +++ b/new-luxc/source/luxc/io.jvm.lux @@ -17,9 +17,14 @@ (def: host-extension Text ".jvm") (def: lux-extension Text ".lux") -(exception: #export File-Not-Found) -(exception: #export Module-Not-Found) -(exception: #export Could-Not-Prepare-Module) +(do-template [] + [(exception: #export ( {message Text}) + message)] + + [File-Not-Found] + [Module-Not-Found] + [Could-Not-Prepare-Module] + ) (def: sanitize (-> Text Text) @@ -29,7 +34,7 @@ (-> (List File) Text (Process [Text File])) (case dirs #.Nil - (io.fail (File-Not-Found path)) + (io.fail (ex.construct File-Not-Found path)) (#.Cons dir dirs') (do io.Monad @@ -61,7 +66,7 @@ ($_ either (find-source dirs (format name host-extension lux-extension)) (find-source dirs (format name lux-extension)) - (io.fail (Module-Not-Found name)))) + (io.fail (ex.construct Module-Not-Found name)))) blob (file.read file)] (wrap [path (blob-to-text blob)]))) @@ -88,8 +93,9 @@ (file.make-directory module-path))] (if made-dir? (wrap []) - (io.fail (Could-Not-Prepare-Module (format "Module: " module-name "\n" - "Target: " target-dir "\n")))))) + (io.fail (ex.construct Could-Not-Prepare-Module + (format "Module: " module-name "\n" + "Target: " target-dir "\n")))))) (def: #export (write target name content) (-> File Text Blob (Process Unit)) -- cgit v1.2.3