From 8bd1d1b3a4750b26f1540717839c1aa196f2a520 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 17 May 2017 20:23:02 -0400 Subject: - Renamed "Error" to "Result". --- new-luxc/source/luxc/compiler.lux | 40 +++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'new-luxc/source/luxc/compiler.lux') diff --git a/new-luxc/source/luxc/compiler.lux b/new-luxc/source/luxc/compiler.lux index 92d4bf8ab..55fe3c738 100644 --- a/new-luxc/source/luxc/compiler.lux +++ b/new-luxc/source/luxc/compiler.lux @@ -3,7 +3,7 @@ (lux (control monad) (concurrency ["A" atom] ["P" promise]) - (data ["E" error] + (data ["R" result] [text "T/" Hash] text/format (coll ["D" dict] @@ -70,19 +70,19 @@ (Lux Code) (function [compiler] (case (&parser;parse (get@ #;source compiler)) - (#E;Error error) - (#E;Error error) + (#R;Error error) + (#R;Error error) - (#E;Success [source' output]) - (#E;Success [(set@ #;source source' compiler) + (#R;Success [source' output]) + (#R;Success [(set@ #;source source' compiler) output])))) (def: (compile-module source-dirs module-name compiler) - (-> (List &;Path) Text Compiler (P;Promise (E;Error Compiler))) + (-> (List &;Path) Text Compiler (P;Promise (R;Result Compiler))) (do P;Monad [?input (&io;read-module source-dirs module-name)] (case ?input - (#E;Success [file-name file-content]) + (#R;Success [file-name file-content]) (let [compilation (do Monad [_ (with-active-compilation [module-name file-name @@ -95,17 +95,17 @@ ## (&module;generate-descriptor module-name) )] (case (macro;run' compiler compilation) - (#E;Success [compiler module-descriptor]) + (#R;Success [compiler module-descriptor]) (do @ [## _ (&io;write-module module-name module-descriptor) ] - (wrap (#E;Success compiler))) + (wrap (#R;Success compiler))) - (#E;Error error) - (wrap (#E;Error error)))) + (#R;Error error) + (wrap (#R;Error error)))) - (#E;Error error) - (wrap (#E;Error error))))) + (#R;Error error) + (wrap (#R;Error error))))) (jvm-import org.objectweb.asm.MethodVisitor) @@ -135,11 +135,11 @@ (array-store +2 (:! (Class Object) Integer.TYPE)) (array-store +3 (:! (Class Object) Integer.TYPE)))] (class-for java.lang.ClassLoader)) - (#E;Success method) + (#R;Success method) (do-to method (AccessibleObject.setAccessible [true])) - (#E;Error error) + (#R;Error error) (error! error))) (def: (memory-class-loader store) @@ -155,10 +155,10 @@ (:! Object (l2i 0)) (:! Object (l2i (nat-to-int (array-length bytecode))))))] ClassLoader::defineClass) - (#E;Success output) + (#R;Success output) [] - (#E;Error error) + (#R;Error error) (error! error)) _ @@ -201,14 +201,14 @@ #;host (:! Void host)}) (def: (or-crash! action) - (All [a] (-> (P;Promise (E;Error a)) (P;Promise a))) + (All [a] (-> (P;Promise (R;Result a)) (P;Promise a))) (do P;Monad [?output action] (case ?output - (#E;Error error) + (#R;Error error) (error! error) - (#E;Success output) + (#R;Success output) (wrap output)))) (def: #export (compile-program program target sources) -- cgit v1.2.3