aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/common-lisp/statement.jvm.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/translation/common-lisp/statement.jvm.lux45
1 files changed, 45 insertions, 0 deletions
diff --git a/new-luxc/source/luxc/lang/translation/common-lisp/statement.jvm.lux b/new-luxc/source/luxc/lang/translation/common-lisp/statement.jvm.lux
new file mode 100644
index 000000000..17f8b4ccb
--- /dev/null
+++ b/new-luxc/source/luxc/lang/translation/common-lisp/statement.jvm.lux
@@ -0,0 +1,45 @@
+(.module:
+ lux
+ (lux (control [monad #+ do])
+ [macro]
+ (data text/format))
+ (luxc (lang [".L" module]
+ (host ["_" common-lisp #+ Expression @@])))
+ [//]
+ (// [".T" runtime]
+ [".T" reference]
+ [".T" eval]))
+
+(def: #export (translate-def name expressionT expressionO metaV)
+ (-> Text Type Expression Code (Meta Unit))
+ (do macro.Monad<Meta>
+ [current-module macro.current-module-name
+ #let [def-ident [current-module name]]]
+ (case (macro.get-symbol-ann (ident-for #.alias) metaV)
+ (#.Some real-def)
+ (do @
+ [[realT realA realV] (macro.find-def real-def)
+ _ (moduleL.define def-ident [realT metaV realV])]
+ (wrap []))
+
+ _
+ (do @
+ [#let [def-name (referenceT.global def-ident)]
+ _ (//.save (_.defparameter def-name expressionO))
+ expressionV (evalT.eval (@@ def-name))
+ _ (moduleL.define def-ident [expressionT metaV expressionV])
+ _ (if (macro.type? metaV)
+ (case (macro.declared-tags metaV)
+ #.Nil
+ (wrap [])
+
+ tags
+ (moduleL.declare-tags tags (macro.export? metaV) (:! Type expressionV)))
+ (wrap []))
+ #let [_ (log! (format "DEF " (%ident def-ident)))]]
+ (wrap []))
+ )))
+
+(def: #export (translate-program programO)
+ (-> Expression (Meta Expression))
+ (macro.fail "translate-program NOT IMPLEMENTED YET"))