diff options
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/generator/expr.jvm.lux | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/new-luxc/source/luxc/generator/expr.jvm.lux b/new-luxc/source/luxc/generator/expr.jvm.lux index 116c29fb5..685bf2335 100644 --- a/new-luxc/source/luxc/generator/expr.jvm.lux +++ b/new-luxc/source/luxc/generator/expr.jvm.lux @@ -1,6 +1,7 @@ (;module: lux - (lux (control monad) + (lux (control monad + ["ex" exception #+ exception:]) (data text/format) [meta #+ Monad<Meta> "Meta/" Monad<Meta>]) (luxc ["&" base] @@ -15,8 +16,11 @@ ["&;" procedure] ["&;" function] ["&;" reference] + [";G" case] (host ["$" jvm])))) +(exception: #export Unrecognized-Synthesis) + (def: #export (generate synthesis) (-> ls;Synthesis (Meta $;Inst)) (case synthesis @@ -47,6 +51,12 @@ (#ls;Definition definition) (&reference;generate-definition definition) + (#ls;Let register inputS exprS) + (caseG;generate-let generate register inputS exprS) + + (#ls;Case inputS pathPS) + (caseG;generate-case generate inputS pathPS) + (#ls;Function arity env body) (&function;generate-function generate env arity body) @@ -57,25 +67,5 @@ (&procedure;generate-procedure generate name args) _ - (meta;fail "Unrecognized synthesis.") + (&;throw Unrecognized-Synthesis "") )) - -## (def: #export (eval type code) -## (-> Type Code (Meta Top)) -## (do Monad<Meta> -## [analysis (&;with-expected-type leftT -## (&analyser;analyser eval code)) -## #let [synthesis (&synthesizer;synthesize analysis)] -## inst (generate synthesis)] -## (&eval;eval inst))) - -## (def: analyse -## &;Analyser -## (&analyser;analyser eval)) - -## (def: #export (generate input) -## (-> Code (Meta Unit)) -## (do Monad<Meta> -## [analysis (analyse input) -## #let [synthesis (&synthesizer;synthesize analysis)]] -## (generate-synthesis synthesis))) |