diff options
author | Eduardo Julian | 2018-04-06 08:32:41 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-04-06 08:32:41 -0400 |
commit | ca238f9c89d3156842b0a3d5fe24a5d69b2eedb0 (patch) | |
tree | 50ba106541f2357daf27393df28e8b263f7311e1 /new-luxc/source/luxc/io.jvm.lux | |
parent | 84d7e87817cd2c074653b34d028c8fa807febc7f (diff) |
- Adapted new-luxc's code to latest stdlib changes.
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/io.jvm.lux | 20 |
1 files changed, 13 insertions, 7 deletions
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 [<name>] + [(exception: #export (<name> {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<Process> @@ -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)) |