aboutsummaryrefslogtreecommitdiff
path: root/lux-lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lux-lua/source/program.lux114
1 files changed, 57 insertions, 57 deletions
diff --git a/lux-lua/source/program.lux b/lux-lua/source/program.lux
index 04f566788..f179bcb43 100644
--- a/lux-lua/source/program.lux
+++ b/lux-lua/source/program.lux
@@ -170,10 +170,10 @@
(let [re_wrap (: (-> java/lang/Object java/lang/Object)
(function (_ unwrapped)
(case (ffi.check [java/lang/Object] unwrapped)
- {#.Some sub_value}
+ {.#Some sub_value}
(|> sub_value (:as (Array java/lang/Object)) lux_structure (:as java/lang/Object))
- #.None
+ {.#None}
unwrapped)))]
(:as program/StructureValue
(ffi.object [] net/sandius/rembulan/impl/DefaultTable [program/StructureValue]
@@ -194,17 +194,17 @@
(net/sandius/rembulan/impl/DefaultTable
[] (rawget self [field java/lang/Object]) java/lang/Object
(case (ffi.check net/sandius/rembulan/ByteString field)
- {#.Some field}
+ {.#Some field}
(case (net/sandius/rembulan/ByteString::decode field)
(^ (static runtime.variant_tag_field))
(|> value (array.read! 0) maybe.trusted)
(^ (static runtime.variant_flag_field))
(case (array.read! 1 value)
- {#.Some _}
+ {.#Some _}
(:as java/lang/Object "")
- #.None
+ {.#None}
(ffi.null))
(^ (static runtime.variant_value_field))
@@ -213,12 +213,12 @@
_
(panic! (exception.error ..unknown_kind_of_object [(:as java/lang/Object field)])))
- #.None
+ {.#None}
(case (ffi.check java/lang/Long field)
- {#.Some idx}
+ {.#Some idx}
(|> value (array.read! (|> idx (:as Nat) --)) maybe.trusted re_wrap)
- #.None
+ {.#None}
(panic! (exception.error ..unknown_kind_of_object [(:as java/lang/Object field)])))))
))))
@@ -230,13 +230,13 @@
(case [(net/sandius/rembulan/Table::get_key (:as java/lang/Object runtime.variant_tag_field) host_object)
(net/sandius/rembulan/Table::get_key (:as java/lang/Object runtime.variant_flag_field) host_object)
(net/sandius/rembulan/Table::get_key (:as java/lang/Object runtime.variant_value_field) host_object)]
- (^multi [{#.Some tag} ?flag {#.Some value}]
+ (^multi [{.#Some tag} ?flag {.#Some value}]
[(read value)
- {#try.Success value}])
- {#try.Success [(: Any (|> tag (:as java/lang/Long) java/lang/Long::intValue))
+ {try.#Success value}])
+ {try.#Success [(: Any (|> tag (:as java/lang/Long) java/lang/Long::intValue))
(: Any (case ?flag
- {#.Some _} (: Any "")
- #.None (:as Any (ffi.null))))
+ {.#Some _} (: Any "")
+ {.#None} (:as Any (ffi.null))))
(: Any value)]}
_
@@ -251,17 +251,17 @@
(array.empty init_num_keys))]
(if (n.< num_keys idx)
(case (net/sandius/rembulan/Table::get_idx (:as java/lang/Long (++ idx)) host_object)
- #.None
+ {.#None}
(recur num_keys (++ idx) output)
- {#.Some member}
+ {.#Some member}
(case (read member)
- {#try.Success parsed_member}
+ {try.#Success parsed_member}
(recur num_keys (++ idx) (array.write! idx (:as java/lang/Object parsed_member) output))
- {#try.Failure error}
- {#try.Failure error}))
- {#try.Success output}))))
+ {try.#Failure error}
+ {try.#Failure error}))
+ {try.#Success output}))))
(exception: .public nil_has_no_lux_representation)
@@ -271,26 +271,26 @@
(exception.except ..nil_has_no_lux_representation []))
(~~ (template [<class> <post_processing>]
[(case (ffi.check <class> host_object)
- {#.Some typed_object}
+ {.#Some typed_object}
(|> typed_object <post_processing>)
_)]
- [java/lang/Boolean #try.Success]
- [java/lang/Long #try.Success]
- [java/lang/Double #try.Success]
- [java/lang/String #try.Success]
- [net/sandius/rembulan/runtime/LuaFunction #try.Success]
- [net/sandius/rembulan/ByteString (<| #try.Success net/sandius/rembulan/ByteString::decode)]
- [program/StructureValue (<| #try.Success program/StructureValue::getValue)]
+ [java/lang/Boolean {try.#Success}]
+ [java/lang/Long {try.#Success}]
+ [java/lang/Double {try.#Success}]
+ [java/lang/String {try.#Success}]
+ [net/sandius/rembulan/runtime/LuaFunction {try.#Success}]
+ [net/sandius/rembulan/ByteString (<| {try.#Success} net/sandius/rembulan/ByteString::decode)]
+ [program/StructureValue (<| {try.#Success} program/StructureValue::getValue)]
))
(case (ffi.check net/sandius/rembulan/impl/DefaultTable host_object)
- {#.Some typed_object}
+ {.#Some typed_object}
(case (read_variant read typed_object)
- {#try.Success value}
- {#try.Success value}
+ {try.#Success value}
+ {try.#Success value}
- {#try.Failure error}
+ {try.#Failure error}
(read_tuple read typed_object))
_)
@@ -327,17 +327,17 @@
(def: (expander baggage macro inputs lux)
(-> Baggage Expander)
(case (..ensure_function macro)
- {#.Some macro}
+ {.#Some macro}
(case (..call_macro baggage inputs lux macro)
- {#try.Success output}
+ {try.#Success output}
(|> output
(:as (Try [Lux (List Code)]))
- #try.Success)
+ {try.#Success})
- {#try.Failure error}
- {#try.Failure error})
+ {try.#Failure error}
+ {try.#Failure error})
- #.None
+ {.#None}
(exception.except ..cannot_apply_a_non_function (:as java/lang/Object macro)))))]
(for [@.old (as_is <jvm>)
@.jvm (as_is <jvm>)
@@ -345,7 +345,7 @@
@.lua
(def: (expander macro inputs lux)
Expander
- {#try.Success ((:as Macro' macro) inputs lux)})]))
+ {try.#Success ((:as Macro' macro) inputs lux)})]))
(with_expansions [<jvm> (as_is (with_expansions [$var_args (_.var "...")
$str_rel_to_abs (_.var "_utf8_str_rel_to_abs")
@@ -552,10 +552,10 @@
output (net/sandius/rembulan/exec/DirectCallExecutor::call state_context (:as java/lang/Object lua_function) (array.empty 0)
executor)]
(case (array.read! 0 output)
- #.None
+ {.#None}
(in [])
- {#.Some value}
+ {.#Some value}
(read value)))))
_ (try.trusted (run! ..rembulan_prelude))]
[[state_context executor]
@@ -596,7 +596,7 @@
(do try.monad
[lua_function (..load (_.code code))]
(let [output ("lua apply" lua_function)]
- {#try.Success (if ("lua object nil?" output)
+ {try.#Success (if ("lua object nil?" output)
[]
output)}))))]
(: (Host _.Expression _.Statement)
@@ -777,24 +777,24 @@
(do io.monad
[[baggage host] ..host]
(in [baggage
- [#platform.&file_system (file.async file.default)
- #platform.host host
- #platform.phase lua.generate
- #platform.runtime runtime.generate
- #platform.phase_wrapper ..phase_wrapper
- #platform.write (|>> _.code (\ utf8.codec encoded))]])))]
+ [platform.#&file_system (file.async file.default)
+ platform.#host host
+ platform.#phase lua.generate
+ platform.#runtime runtime.generate
+ platform.#phase_wrapper ..phase_wrapper
+ platform.#write (|>> _.code (\ utf8.codec encoded))]])))]
(for [@.old <jvm>
@.jvm <jvm>
@.lua (def: platform
(IO (Platform [Register _.Label] _.Expression _.Statement))
(do io.monad
[host ..host]
- (in [#platform.&file_system (file.async file.default)
- #platform.host host
- #platform.phase lua.generate
- #platform.runtime runtime.generate
- #platform.phase_wrapper ..phase_wrapper
- #platform.write (|>> _.code (\ utf8.codec encoded))])))]))
+ (in [platform.#&file_system (file.async file.default)
+ platform.#host host
+ platform.#phase lua.generate
+ platform.#runtime runtime.generate
+ platform.#phase_wrapper ..phase_wrapper
+ platform.#write (|>> _.code (\ utf8.codec encoded))])))]))
(def: (program context program)
(Program _.Expression _.Statement)
@@ -815,10 +815,10 @@
@.lua platform]))
..platform]
(exec (do async.monad
- [_ (/.compiler [#/static.host @.lua
- #/static.host_module_extension extension
- #/static.target (/cli.target service)
- #/static.artifact_extension extension]
+ [_ (/.compiler [/static.#host @.lua
+ /static.#host_module_extension extension
+ /static.#target (/cli.target service)
+ /static.#artifact_extension extension]
(for [@.old (..expander baggage)
@.jvm (..expander baggage)
@.lua ..expander])