diff options
author | Eduardo Julian | 2017-10-29 22:21:14 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-10-29 22:21:14 -0400 |
commit | 7b870a7bd124f35939d9089a2e21f0806a4c6e85 (patch) | |
tree | 076fb3544dbb1a811cfbb9dd54008b0753dead16 /new-luxc/source/luxc/generator/structure.jvm.lux | |
parent | 2dc99a7b62fc5fc19d9982ad4398606f3aebb7a5 (diff) |
- Fixed some bugs.
- Improved error reporting.
- Implemented macro-expansion (for JVM).
- Implemented "let" compilation.
Diffstat (limited to 'new-luxc/source/luxc/generator/structure.jvm.lux')
-rw-r--r-- | new-luxc/source/luxc/generator/structure.jvm.lux | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/new-luxc/source/luxc/generator/structure.jvm.lux b/new-luxc/source/luxc/generator/structure.jvm.lux index cee5800cd..28196b914 100644 --- a/new-luxc/source/luxc/generator/structure.jvm.lux +++ b/new-luxc/source/luxc/generator/structure.jvm.lux @@ -3,9 +3,10 @@ (lux (control [monad #+ do]) (data text/format (coll [list])) - [meta #+ Monad<Meta> "Meta/" Monad<Meta>] + [meta] [host #+ do-to]) (luxc ["&" base] + [";L" host] (lang ["la" analysis] ["ls" synthesis]) ["&;" analyser] @@ -21,7 +22,7 @@ (def: #export (generate-tuple generate members) (-> (-> ls;Synthesis (Meta $;Inst)) (List ls;Synthesis) (Meta $;Inst)) - (do Monad<Meta> + (do meta;Monad<Meta> [#let [size (list;size members)] _ (&;assert "Cannot generate tuples with less than 2 elements." (n.>= +2 size)) @@ -47,12 +48,12 @@ (def: #export (generate-variant generate tag tail? member) (-> (-> ls;Synthesis (Meta $;Inst)) Nat Bool ls;Synthesis (Meta $;Inst)) - (do Monad<Meta> + (do meta;Monad<Meta> [memberI (generate member)] (wrap (|>. ($i;int (nat-to-int tag)) (flagI tail?) memberI - ($i;INVOKESTATIC ../runtime;runtime-class + ($i;INVOKESTATIC hostL;runtime-class "variant_make" ($t;method (list $t;int $Object $Object) (#;Some ($t;array +1 $Object)) |