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/base.jvm.lux | 3 +-- new-luxc/source/luxc/compiler/common.jvm.lux | 22 +++++++++++----------- new-luxc/source/luxc/compiler/expr.jvm.lux | 3 ++- new-luxc/source/luxc/compiler/runtime.jvm.lux | 6 +++--- new-luxc/source/luxc/compiler/statement.jvm.lux | 3 +-- 5 files changed, 18 insertions(+), 19 deletions(-) (limited to 'new-luxc/source/luxc/compiler') diff --git a/new-luxc/source/luxc/compiler/base.jvm.lux b/new-luxc/source/luxc/compiler/base.jvm.lux index f5784319a..01a97aec4 100644 --- a/new-luxc/source/luxc/compiler/base.jvm.lux +++ b/new-luxc/source/luxc/compiler/base.jvm.lux @@ -3,8 +3,7 @@ (lux (control monad) [io #- run] (concurrency ["A" atom]) - (data ["E" error] - [text] + (data [text] text/format) host) (luxc ["&" base])) diff --git a/new-luxc/source/luxc/compiler/common.jvm.lux b/new-luxc/source/luxc/compiler/common.jvm.lux index d7abc1ff1..bd5487ef6 100644 --- a/new-luxc/source/luxc/compiler/common.jvm.lux +++ b/new-luxc/source/luxc/compiler/common.jvm.lux @@ -1,7 +1,7 @@ (;module: lux (lux (concurrency ["A" atom]) - (data ["E" error] + (data ["R" result] (coll ["D" dict])) [macro] [host #+ jvm-import])) @@ -33,13 +33,13 @@ (:! Host) (get@ #visitor))) -(def: (visitor::put visitor compiler) - (-> MethodVisitor Compiler Compiler) +(def: (visitor::put ?visitor compiler) + (-> (Maybe MethodVisitor) Compiler Compiler) (update@ #;host (function [host] (|> host (:! Host) - (set@ #visitor (#;Some visitor)) + (set@ #visitor ?visitor) (:! Void))) compiler)) @@ -48,18 +48,18 @@ (function [compiler] (case (visitor::get compiler) #;None - (#E;Error "No visitor has been set.") + (#R;Error "No visitor has been set.") (#;Some visitor) - (#E;Success [compiler visitor])))) + (#R;Success [compiler visitor])))) (def: #export (with-visitor visitor body) (All [a] (-> MethodVisitor (Lux a) (Lux a))) (function [compiler] - (case (macro;run' (visitor::put visitor compiler) body) - (#E;Error error) - (#E;Error error) + (case (macro;run' (visitor::put (#;Some visitor) compiler) body) + (#R;Error error) + (#R;Error error) - (#E;Success [compiler' output]) - (#E;Success [(visitor::put (visitor::get compiler) compiler') + (#R;Success [compiler' output]) + (#R;Success [(visitor::put (visitor::get compiler) compiler') output])))) diff --git a/new-luxc/source/luxc/compiler/expr.jvm.lux b/new-luxc/source/luxc/compiler/expr.jvm.lux index 173293b1c..b2e4923c4 100644 --- a/new-luxc/source/luxc/compiler/expr.jvm.lux +++ b/new-luxc/source/luxc/compiler/expr.jvm.lux @@ -5,7 +5,8 @@ [macro #+ Monad "Lux/" Monad] [host #+ jvm-import]) (luxc ["&" base] - (lang ["ls" synthesis]) + (lang ["la" analysis] + ["ls" synthesis]) ["&;" analyser] ["&;" synthesizer] (compiler ["&;" common]))) diff --git a/new-luxc/source/luxc/compiler/runtime.jvm.lux b/new-luxc/source/luxc/compiler/runtime.jvm.lux index 4a5e44785..16e072194 100644 --- a/new-luxc/source/luxc/compiler/runtime.jvm.lux +++ b/new-luxc/source/luxc/compiler/runtime.jvm.lux @@ -3,9 +3,9 @@ (lux (control monad) (concurrency ["P" promise "P/" Monad]) (data text/format - ["E" error])) + ["R" result])) (luxc ["&" base])) (def: #export (compile-runtime compiler) - (-> Compiler (P;Promise (E;Error Compiler))) - (P/wrap (#E;Success compiler))) + (-> Compiler (P;Promise (R;Result Compiler))) + (P/wrap (#R;Success compiler))) diff --git a/new-luxc/source/luxc/compiler/statement.jvm.lux b/new-luxc/source/luxc/compiler/statement.jvm.lux index 7e48d061f..96263181f 100644 --- a/new-luxc/source/luxc/compiler/statement.jvm.lux +++ b/new-luxc/source/luxc/compiler/statement.jvm.lux @@ -2,8 +2,7 @@ lux (lux (control monad) [io #- run] - (data ["E" error] - [text "T/" Eq] + (data [text "T/" Eq] text/format) [macro #+ Monad]) (luxc ["&" base] -- cgit v1.2.3