diff options
author | Eduardo Julian | 2019-04-11 22:30:05 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-04-11 22:30:05 -0400 |
commit | f2937706edb6887c5eb1a6a0b6668b1334f5ef3b (patch) | |
tree | e2c3b657aaa39b61ff0746fa0f59416514f87206 /new-luxc/source/luxc/lang/translation/lua/statement.jvm.lux | |
parent | 6c3e9f8c02ce153380392ba5bc8eeb517de5f781 (diff) |
WIP: Lua compiler.
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/lua/statement.jvm.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/lua/statement.jvm.lux | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/new-luxc/source/luxc/lang/translation/lua/statement.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/statement.jvm.lux deleted file mode 100644 index 9c0181c1b..000000000 --- a/new-luxc/source/luxc/lang/translation/lua/statement.jvm.lux +++ /dev/null @@ -1,48 +0,0 @@ -(.module: - lux - (lux (control [monad #+ do]) - [macro] - (data text/format)) - (luxc (lang [".L" module] - (host [lua #+ Lua Expression Statement]))) - [//] - (// [".T" runtime] - [".T" reference] - [".T" eval])) - -(def: #export (translate-def name expressionT expressionO metaV) - (-> Text Type Expression Code (Meta Any)) - (do macro.Monad<Meta> - [current-module macro.current-module-name - #let [def-name [current-module name]]] - (case (macro.get-identifier-ann (name-of #.alias) metaV) - (#.Some real-def) - (do @ - [[realT realA realV] (macro.find-def real-def) - _ (moduleL.define def-name [realT metaV realV])] - (wrap [])) - - _ - (do @ - [#let [def-name (referenceT.global def-name)] - _ (//.save (lua.global! def-name (#.Some expressionO))) - expressionV (evalT.eval def-name) - _ (moduleL.define def-name [expressionT metaV expressionV]) - _ (if (macro.type? metaV) - (case (macro.declared-tags metaV) - #.Nil - (wrap []) - - tags - (moduleL.declare-tags tags (macro.export? metaV) (:coerce Type expressionV))) - (wrap [])) - #let [_ (log! (format "DEF " (%name def-name)))]] - (wrap [])) - ))) - -(def: #export (translate-program programO) - (-> Expression (Meta Statement)) - (macro.fail "translate-program NOT IMPLEMENTED YET") - ## (hostT.save (format "var " (referenceT.variable +0) " = " runtimeT.lux//program-args "();" - ## "(" programO ")(null);")) - ) |