diff options
author | Eduardo Julian | 2017-06-14 17:56:24 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-06-14 17:56:24 -0400 |
commit | c7e53036704b1a89b740c023c7b4bcc74b7e956a (patch) | |
tree | fa75c05b4233e654c17edd4de2d2b0b6fb3cece9 /new-luxc/source/luxc/generator/expr.jvm.lux | |
parent | 9cd2927a4f6175784e081d6b512d3e900c8069e7 (diff) |
- Heavy refactoring.
Diffstat (limited to 'new-luxc/source/luxc/generator/expr.jvm.lux')
-rw-r--r-- | new-luxc/source/luxc/generator/expr.jvm.lux | 30 |
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 |