diff options
author | Eduardo Julian | 2023-01-13 16:14:20 -0400 |
---|---|---|
committer | Eduardo Julian | 2023-01-13 16:14:20 -0400 |
commit | 913171900fd11272ca328ded6553a56423db1e13 (patch) | |
tree | e101c51aa5b4467eed4e7b956d2d941cd46f4b10 /stdlib/source/test/lux/meta/compiler/language | |
parent | 617069b3986e9271d6e73191b899aa914e430dd6 (diff) |
Can now compile complex values (i.e. variants & tuples) in C++.
Diffstat (limited to 'stdlib/source/test/lux/meta/compiler/language')
-rw-r--r-- | stdlib/source/test/lux/meta/compiler/language/lux/phase.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/runtime.lux | 52 |
2 files changed, 55 insertions, 1 deletions
diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase.lux index ba39fe79e..d9af04496 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/phase.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase.lux @@ -31,7 +31,8 @@ ["[1]/[0]" host] ["[1]/[0]" primitive] ["[1]/[0]" type] - ["[1]/[0]" value]]]]) + ["[1]/[0]" value] + ["[1]/[0]" runtime]]]]) (def (injection value) (All (_ of) @@ -219,4 +220,5 @@ /translation/jvm/primitive.test /translation/jvm/type.test /translation/jvm/value.test + /translation/jvm/runtime.test ))) diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/runtime.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/runtime.lux new file mode 100644 index 000000000..97035f3c5 --- /dev/null +++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/runtime.lux @@ -0,0 +1,52 @@ +(.require + [library + [lux (.except) + [abstract + [monad (.only do)]] + [control + ["[0]" io] + ["[0]" try]] + [math + ["[0]" random (.only Random)]] + [meta + [type + ["[0]" check]]] + [test + ["_" property (.only Test)]]]] + [\\library + ["[0]" / (.only) + [// + ["[0]" host] + [//// + ["[0]" phase] + ["[0]" translation]]]]]) + +(def .public test + Test + (<| (_.covering /._) + (do [! random.monad] + [module (random.lower_cased 1)]) + (`` (all _.and + (,, (with_template [</> <//>] + [(_.coverage [</>] + (check.subsumes? </> <//>))] + + [/.State translation.State] + [/.Operation translation.Operation] + [/.Phase translation.Phase] + [/.Handler translation.Handler] + [/.Bundle translation.Bundle] + [/.Extender translation.Extender] + )) + (_.coverage [/.translation] + (let [[_ host] (io.run! host.host) + state (is /.State + (translation.state host module))] + (|> (do try.monad + [_ (phase.result state + (do phase.monad + [_ (translation.set_buffer translation.empty_buffer)] + /.translation))] + (in true)) + (try.else false)))) + )))) |