aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/tool
diff options
context:
space:
mode:
authorEduardo Julian2021-07-10 03:10:43 -0400
committerEduardo Julian2021-07-10 03:10:43 -0400
commit4610968193df10af12c91f699fec39aeb3ef703a (patch)
tree27d1578548ad49f5aefe76fb696a7af10361c9cf /stdlib/source/lux/tool
parentf3e869d0246e956399ec31a074c6c6299ff73602 (diff)
Made the "try" macro into a common one, instead of a host-specific one.
Diffstat (limited to 'stdlib/source/lux/tool')
-rw-r--r--stdlib/source/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux21
-rw-r--r--stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux2
2 files changed, 11 insertions, 12 deletions
diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux
index 17c27fe4f..8c5cbcd09 100644
--- a/stdlib/source/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux
+++ b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux
@@ -3,11 +3,10 @@
[abstract
["." monad (#+ do)]]
[control
- [io (#+ IO)]
["." try]
["." exception (#+ exception:)]
["<>" parser
- ["<c>" code (#+ Parser)]]]
+ ["<.>" code (#+ Parser)]]]
[data
["." maybe]
["." text
@@ -40,7 +39,7 @@
(-> Text Phase Archive s (Operation Analysis))]
Handler))
(function (_ extension_name analyse archive args)
- (case (<c>.run syntax args)
+ (case (<code>.run syntax args)
(#try.Success inputs)
(handler extension_name analyse archive inputs)
@@ -88,7 +87,7 @@
(def: text_char
(Parser text.Char)
(do <>.monad
- [raw <c>.text]
+ [raw <code>.text]
(case (text.size raw)
1 (wrap (|> raw (text.nth 0) maybe.assume))
_ (<>.fail (exception.construct ..char_text_must_be_size_1 [raw])))))
@@ -96,10 +95,10 @@
(def: lux::syntax_char_case!
(..custom
[($_ <>.and
- <c>.any
- (<c>.tuple (<>.some (<>.and (<c>.tuple (<>.many ..text_char))
- <c>.any)))
- <c>.any)
+ <code>.any
+ (<code>.tuple (<>.some (<>.and (<code>.tuple (<>.many ..text_char))
+ <code>.any)))
+ <code>.any)
(function (_ extension_name phase archive [input conditionals else])
(do {! ////.monad}
[input (typeA.with_type text.Char
@@ -140,7 +139,7 @@
(do ////.monad
[[var_id varT] (typeA.with_env check.var)
_ (typeA.infer (type (Either Text varT)))
- opA (typeA.with_type (type (IO varT))
+ opA (typeA.with_type (type (-> .Any varT))
(analyse archive opC))]
(wrap (#////analysis.Extension extension_name (list opA))))
@@ -194,7 +193,7 @@
(def: (caster input output)
(-> Type Type Handler)
(..custom
- [<c>.any
+ [<code>.any
(function (_ extension_name phase archive valueC)
(do {! ////.monad}
[_ (typeA.infer output)]
@@ -204,7 +203,7 @@
(def: lux::macro
Handler
(..custom
- [<c>.any
+ [<code>.any
(function (_ extension_name phase archive valueC)
(do {! ////.monad}
[_ (typeA.infer .Macro)
diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux
index ec3080fc2..1c31c7ed9 100644
--- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux
+++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux
@@ -1,5 +1,5 @@
(.module:
- [lux (#- Type Definition case false true)
+ [lux (#- Type Definition case false true try)
[abstract
["." monad (#+ do)]
["." enum]]