aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/synthesizer.lux
diff options
context:
space:
mode:
Diffstat (limited to 'new-luxc/source/luxc/synthesizer.lux')
-rw-r--r--new-luxc/source/luxc/synthesizer.lux39
1 files changed, 36 insertions, 3 deletions
diff --git a/new-luxc/source/luxc/synthesizer.lux b/new-luxc/source/luxc/synthesizer.lux
index 900c16e05..c0aaec6ad 100644
--- a/new-luxc/source/luxc/synthesizer.lux
+++ b/new-luxc/source/luxc/synthesizer.lux
@@ -1,12 +1,45 @@
(;module:
lux
(lux (control monad)
- (data text/format)
+ (data text/format
+ (coll [list "L/" Functor<List>]))
[macro #+ Monad<Lux>])
(luxc ["&" base]
- lang
+ (lang ["la" analysis #+ Analysis]
+ ["ls" synthesis #+ Synthesis])
["&;" analyser]))
(def: #export (synthesize analysis)
(-> Analysis Synthesis)
- (undefined))
+ (case analysis
+ (^template [<from> <to>]
+ [meta (<from> value)]
+ (<to> value))
+ ([#la;Unit #ls;Unit]
+ [#la;Bool #ls;Bool]
+ [#la;Nat #ls;Nat]
+ [#la;Int #ls;Int]
+ [#la;Deg #ls;Deg]
+ [#la;Real #ls;Real]
+ [#la;Char #ls;Char]
+ [#la;Text #ls;Text]
+ [#la;Relative #ls;Relative]
+ [#la;Absolute #ls;Absolute])
+
+ [meta (#la;Tuple values)]
+ (#ls;Tuple (L/map synthesize values))
+
+ [meta (#la;Variant tag last? value)]
+ (#ls;Variant tag last? (synthesize value))
+
+ [meta (#la;Function scope body)]
+ (#ls;Function scope (synthesize body))
+
+ [meta (#la;Call func args)]
+ (#ls;Call (synthesize func) (L/map synthesize args))
+
+ [meta (#la;Procedure name args)]
+ (#ls;Procedure name (L/map synthesize args))
+
+ [meta (#la;Case pattern)]
+ (undefined)))