diff options
author | Eduardo Julian | 2019-04-16 20:53:41 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-04-16 20:53:41 -0400 |
commit | 697707d8560a5735be38fd9b1ff91a02c289d48f (patch) | |
tree | 7f9e81974c9ec3ede82e7f2392ebba037e3e9df8 /new-luxc/source/luxc/lang/translation/jvm/structure.jvm.lux | |
parent | 42248854f0cb5e3364e6aae25527cee65cbda3e8 (diff) |
Made some new-luxc modules "old".
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/jvm/structure.jvm.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm/structure.jvm.lux | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/new-luxc/source/luxc/lang/translation/jvm/structure.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/structure.jvm.lux deleted file mode 100644 index 527228c8e..000000000 --- a/new-luxc/source/luxc/lang/translation/jvm/structure.jvm.lux +++ /dev/null @@ -1,70 +0,0 @@ -(.module: - [lux #* - [abstract - ["." monad (#+ do)]] - [control - ["ex" exception (#+ exception:)]] - [data - [text - format] - [collection - ["." list]]] - [tool - [compiler - [synthesis (#+ Synthesis)] - ["." phase]]]] - [luxc - [lang - [host - ["." jvm (#+ Inst Operation Phase) - ["$t" type] - ["_" inst]]]]] - ["." //]) - -(exception: #export (not-a-tuple {size Nat}) - (ex.report ["Expected size" ">= 2"] - ["Actual size" (%n size)])) - -(def: $Object jvm.Type ($t.class "java.lang.Object" (list))) - -(def: #export (tuple translate members) - (-> Phase (List Synthesis) (Operation Inst)) - (do phase.monad - [#let [size (list.size members)] - _ (phase.assert not-a-tuple size - (n/>= 2 size)) - membersI (|> members - list.enumerate - (monad.map @ (function (_ [idx member]) - (do @ - [memberI (translate member)] - (wrap (|>> _.DUP - (_.int (.int idx)) - memberI - _.AASTORE))))) - (:: @ map _.fuse))] - (wrap (|>> (_.int (.int size)) - (_.array $Object) - membersI)))) - -(def: (flagI right?) - (-> Bit Inst) - (if right? - (_.string "") - _.NULL)) - -(def: #export (variant translate lefts right? member) - (-> Phase Nat Bit Synthesis (Operation Inst)) - (do phase.monad - [memberI (translate member)] - (wrap (|>> (_.int (.int (if right? - (.inc lefts) - lefts))) - (flagI right?) - memberI - (_.INVOKESTATIC //.runtime-class - "variant_make" - ($t.method (list $t.int $Object $Object) - (#.Some ($t.array 1 $Object)) - (list)) - #0))))) |