aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/lua
diff options
context:
space:
mode:
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/lua')
-rw-r--r--new-luxc/source/luxc/lang/translation/lua/procedure.jvm.lux29
-rw-r--r--new-luxc/source/luxc/lang/translation/lua/reference.jvm.lux4
-rw-r--r--new-luxc/source/luxc/lang/translation/lua/statement.jvm.lux12
3 files changed, 8 insertions, 37 deletions
diff --git a/new-luxc/source/luxc/lang/translation/lua/procedure.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/procedure.jvm.lux
deleted file mode 100644
index eaffddfa0..000000000
--- a/new-luxc/source/luxc/lang/translation/lua/procedure.jvm.lux
+++ /dev/null
@@ -1,29 +0,0 @@
-(.module:
- lux
- (lux (control [monad #+ do]
- ["ex" exception #+ exception:])
- (data [maybe]
- text/format
- (coll (dictionary ["dict" unordered #+ Dict]))))
- (luxc ["&" lang]
- (lang ["ls" synthesis]
- (host [lua #+ Lua Expression Statement])))
- [//]
- (/ ["/." common]
- ["/." host]))
-
-(exception: #export (Unknown-Procedure {message Text})
- message)
-
-(def: procedures
- /common.Bundle
- (|> /common.procedures
- (dict.merge /host.procedures)))
-
-(def: #export (translate-procedure translate name args)
- (-> (-> ls.Synthesis (Meta Expression)) Text (List ls.Synthesis)
- (Meta Expression))
- (<| (maybe.default (&.throw Unknown-Procedure (%t name)))
- (do maybe.Monad<Maybe>
- [proc (dict.get name procedures)]
- (wrap (proc translate args)))))
diff --git a/new-luxc/source/luxc/lang/translation/lua/reference.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/reference.jvm.lux
index b491c9dd4..fac6308a0 100644
--- a/new-luxc/source/luxc/lang/translation/lua/reference.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/lua/reference.jvm.lux
@@ -28,9 +28,9 @@
(translate-local (.nat var))))
(def: #export global
- (-> Ident Expression)
+ (-> Name Expression)
//.definition-name)
(def: #export (translate-definition name)
- (-> Ident (Meta Expression))
+ (-> Name (Meta Expression))
(:: macro.Monad<Meta> wrap (global name)))
diff --git a/new-luxc/source/luxc/lang/translation/lua/statement.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/statement.jvm.lux
index 4fb814f6c..9c0181c1b 100644
--- a/new-luxc/source/luxc/lang/translation/lua/statement.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/lua/statement.jvm.lux
@@ -14,20 +14,20 @@
(-> Text Type Expression Code (Meta Any))
(do macro.Monad<Meta>
[current-module macro.current-module-name
- #let [def-ident [current-module name]]]
- (case (macro.get-identifier-ann (ident-for #.alias) metaV)
+ #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-ident [realT metaV realV])]
+ _ (moduleL.define def-name [realT metaV realV])]
(wrap []))
_
(do @
- [#let [def-name (referenceT.global def-ident)]
+ [#let [def-name (referenceT.global def-name)]
_ (//.save (lua.global! def-name (#.Some expressionO)))
expressionV (evalT.eval def-name)
- _ (moduleL.define def-ident [expressionT metaV expressionV])
+ _ (moduleL.define def-name [expressionT metaV expressionV])
_ (if (macro.type? metaV)
(case (macro.declared-tags metaV)
#.Nil
@@ -36,7 +36,7 @@
tags
(moduleL.declare-tags tags (macro.export? metaV) (:coerce Type expressionV)))
(wrap []))
- #let [_ (log! (format "DEF " (%ident def-ident)))]]
+ #let [_ (log! (format "DEF " (%name def-name)))]]
(wrap []))
)))