diff options
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/compiler/common.jvm.lux | 22 |
1 files changed, 11 insertions, 11 deletions
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])))) |