aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/generator/expr.jvm.lux
diff options
context:
space:
mode:
Diffstat (limited to 'new-luxc/source/luxc/generator/expr.jvm.lux')
-rw-r--r--new-luxc/source/luxc/generator/expr.jvm.lux30
1 files changed, 17 insertions, 13 deletions
diff --git a/new-luxc/source/luxc/generator/expr.jvm.lux b/new-luxc/source/luxc/generator/expr.jvm.lux
index 4b038378a..7a99ecc18 100644
--- a/new-luxc/source/luxc/generator/expr.jvm.lux
+++ b/new-luxc/source/luxc/generator/expr.jvm.lux
@@ -1,20 +1,19 @@
(;module:
lux
(lux (control monad)
- (data text/format)
- [macro #+ Monad<Lux> "Lux/" Monad<Lux>]
- [host #+ jvm-import])
+ [macro #+ Monad<Lux> "Lux/" Monad<Lux>])
(luxc ["&" base]
- (lang ["la" analysis]
- ["ls" synthesis])
+ (lang ["ls" synthesis])
["&;" analyser]
["&;" synthesizer]
(generator ["&;" common]
["&;" primitive]
- ["&;" structure])))
+ ["&;" structure]
+ ["&;" eval]
+ (host ["$" jvm]))))
(def: #export (generate synthesis)
- (-> ls;Synthesis (Lux Unit))
+ (-> ls;Synthesis (Lux $;Inst))
(case synthesis
#ls;Unit
&primitive;generate-unit
@@ -23,9 +22,9 @@
(<tag> value)
(<generator> value))
([#ls;Bool &primitive;generate-bool]
- [#ls;Nat &primitive;generate-nat]
- [#ls;Int &primitive;generate-int]
- [#ls;Deg &primitive;generate-deg]
+ [#ls;Nat &primitive;generate-nat]
+ [#ls;Int &primitive;generate-int]
+ [#ls;Deg &primitive;generate-deg]
[#ls;Real &primitive;generate-real]
[#ls;Char &primitive;generate-char]
[#ls;Text &primitive;generate-text])
@@ -39,9 +38,14 @@
_
(macro;fail "Unrecognized synthesis.")))
-## (def: (eval type code)
-## &;Eval
-## (undefined))
+## (def: #export (eval type code)
+## (-> Type Code (Lux Top))
+## (do Monad<Lux>
+## [analysis (&;with-expected-type leftT
+## (&analyser;analyser eval code))
+## #let [synthesis (&synthesizer;synthesize analysis)]
+## inst (generate synthesis)]
+## (&eval;eval inst)))
## (def: analyse
## &;Analyser