aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/js
diff options
context:
space:
mode:
authorEduardo Julian2018-07-22 02:52:46 -0400
committerEduardo Julian2018-07-22 02:52:46 -0400
commitb14102eaa2a80f51f160ba293ec01928dbe683c3 (patch)
treebf2640c4503de8c9f0a8f6b048548ef1a0bd4e83 /new-luxc/source/luxc/lang/translation/js
parent9671d6064dd02dfe6c32492f5b9907b096e5bd89 (diff)
- Some fixes due to recent changes in stdlib.
- Removed some (now) useless modules.
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/translation/js.lux4
-rw-r--r--new-luxc/source/luxc/lang/translation/js/imports.jvm.lux2
-rw-r--r--new-luxc/source/luxc/lang/translation/js/procedure.jvm.lux29
-rw-r--r--new-luxc/source/luxc/lang/translation/js/reference.jvm.lux4
-rw-r--r--new-luxc/source/luxc/lang/translation/js/statement.jvm.lux14
5 files changed, 12 insertions, 41 deletions
diff --git a/new-luxc/source/luxc/lang/translation/js.lux b/new-luxc/source/luxc/lang/translation/js.lux
index 9daf7330c..ddad4d389 100644
--- a/new-luxc/source/luxc/lang/translation/js.lux
+++ b/new-luxc/source/luxc/lang/translation/js.lux
@@ -313,7 +313,7 @@
(text.replace-all "-" "_")))
(def: #export (definition-name [module name])
- (-> Ident Text)
+ (-> Name Text)
(format (module-name module) "$" (lang.normalize-name name)))
(def: #export (save-js code)
@@ -325,7 +325,7 @@
(execute code)))
(def: #export (save-definition name code)
- (-> Ident Expression (Meta Any))
+ (-> Name Expression (Meta Any))
(save-js (format "var " (definition-name name) " = " code ";\n")))
(def: #export (save-module! target)
diff --git a/new-luxc/source/luxc/lang/translation/js/imports.jvm.lux b/new-luxc/source/luxc/lang/translation/js/imports.jvm.lux
index 36500e737..575650457 100644
--- a/new-luxc/source/luxc/lang/translation/js/imports.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/js/imports.jvm.lux
@@ -36,7 +36,7 @@
(do macro.Monad<Meta>
[_ (moduleL.set-annotations annotations)
current-module macro.current-module-name
- imports (let [imports (|> (macro.get-tuple-ann (ident-for #.imports) annotations)
+ imports (let [imports (|> (macro.get-tuple-ann (name-of #.imports) annotations)
(maybe.default (list)))]
(case (s.run imports (p.some import))
(#e.Success imports)
diff --git a/new-luxc/source/luxc/lang/translation/js/procedure.jvm.lux b/new-luxc/source/luxc/lang/translation/js/procedure.jvm.lux
deleted file mode 100644
index cd5757663..000000000
--- a/new-luxc/source/luxc/lang/translation/js/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 [js #+ JS 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/js/reference.jvm.lux b/new-luxc/source/luxc/lang/translation/js/reference.jvm.lux
index e4231ba6b..69a0075b1 100644
--- a/new-luxc/source/luxc/lang/translation/js/reference.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/js/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/js/statement.jvm.lux b/new-luxc/source/luxc/lang/translation/js/statement.jvm.lux
index fddc8e045..21e52fe28 100644
--- a/new-luxc/source/luxc/lang/translation/js/statement.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/js/statement.jvm.lux
@@ -14,19 +14,19 @@
(-> 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 @
- [_ (//.save-definition def-ident expressionJS)
- expressionV (evalT.eval (referenceT.global def-ident))
- _ (moduleL.define def-ident [expressionT metaV expressionV])
+ [_ (//.save-definition def-name expressionJS)
+ expressionV (evalT.eval (referenceT.global def-name))
+ _ (moduleL.define def-name [expressionT metaV expressionV])
_ (if (macro.type? metaV)
(case (macro.declared-tags metaV)
#.Nil
@@ -35,7 +35,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 []))
)))