aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source
diff options
context:
space:
mode:
authorEduardo Julian2018-01-08 21:40:06 -0400
committerEduardo Julian2018-01-08 21:40:06 -0400
commit9eaaaf953ba7ce1eeb805603f4e113aa15f5178f (patch)
treeef134eecc8a5767a997fce0637cd64e0ebcee6b1 /new-luxc/source
parentf523bc14d43286348aeb200bd0554812dc6ef28d (diff)
- Moved all translation code under the JVM path (in preparation for porting the JS back-end).
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/analysis/expression.lux2
-rw-r--r--new-luxc/source/luxc/lang/eval.lux4
-rw-r--r--new-luxc/source/luxc/lang/extension/statement.lux6
-rw-r--r--new-luxc/source/luxc/lang/host.jvm.lux2
-rw-r--r--new-luxc/source/luxc/lang/macro.lux2
-rw-r--r--new-luxc/source/luxc/lang/translation.lux15
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/case.jvm.lux (renamed from new-luxc/source/luxc/lang/translation/case.jvm.lux)0
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/common.jvm.lux (renamed from new-luxc/source/luxc/lang/translation/common.jvm.lux)0
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/eval.jvm.lux (renamed from new-luxc/source/luxc/lang/translation/eval.jvm.lux)5
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/expression.jvm.lux (renamed from new-luxc/source/luxc/lang/translation/expression.jvm.lux)22
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux (renamed from new-luxc/source/luxc/lang/translation/function.jvm.lux)8
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/imports.jvm.lux (renamed from new-luxc/source/luxc/lang/translation/imports.jvm.lux)0
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/loop.jvm.lux (renamed from new-luxc/source/luxc/lang/translation/loop.jvm.lux)8
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/primitive.jvm.lux (renamed from new-luxc/source/luxc/lang/translation/primitive.jvm.lux)4
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/procedure.jvm.lux (renamed from new-luxc/source/luxc/lang/translation/procedure.jvm.lux)0
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux (renamed from new-luxc/source/luxc/lang/translation/procedure/common.jvm.lux)10
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/procedure/host.jvm.lux (renamed from new-luxc/source/luxc/lang/translation/procedure/host.jvm.lux)2
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/reference.jvm.lux (renamed from new-luxc/source/luxc/lang/translation/reference.jvm.lux)4
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/runtime.jvm.lux (renamed from new-luxc/source/luxc/lang/translation/runtime.jvm.lux)4
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/statement.jvm.lux (renamed from new-luxc/source/luxc/lang/translation/statement.jvm.lux)8
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/structure.jvm.lux (renamed from new-luxc/source/luxc/lang/translation/structure.jvm.lux)4
-rw-r--r--new-luxc/source/luxc/repl.lux2
22 files changed, 57 insertions, 55 deletions
diff --git a/new-luxc/source/luxc/lang/analysis/expression.lux b/new-luxc/source/luxc/lang/analysis/expression.lux
index d19e98bd8..8907ba665 100644
--- a/new-luxc/source/luxc/lang/analysis/expression.lux
+++ b/new-luxc/source/luxc/lang/analysis/expression.lux
@@ -15,7 +15,7 @@
[".L" macro]
[".L" extension]
["la" analysis]
- (translation [".T" common])))
+ (translation (jvm [".T" common]))))
(// [".A" common]
[".A" function]
[".A" primitive]
diff --git a/new-luxc/source/luxc/lang/eval.lux b/new-luxc/source/luxc/lang/eval.lux
index 87cbadfa0..eb16cc433 100644
--- a/new-luxc/source/luxc/lang/eval.lux
+++ b/new-luxc/source/luxc/lang/eval.lux
@@ -6,8 +6,8 @@
(lang [".L" extension]
(analysis [".A" expression])
(synthesis [".S" expression])
- (translation [".T" expression]
- [".T" eval]))))
+ (translation (jvm [".T" expression]
+ [".T" eval])))))
(def: #export (eval type exprC)
&.Eval
diff --git a/new-luxc/source/luxc/lang/extension/statement.lux b/new-luxc/source/luxc/lang/extension/statement.lux
index 7eb2b36bf..31e1759a0 100644
--- a/new-luxc/source/luxc/lang/extension/statement.lux
+++ b/new-luxc/source/luxc/lang/extension/statement.lux
@@ -17,9 +17,9 @@
(analysis [".A" common]
[".A" expression])
(synthesis [".S" expression])
- (translation [".T" expression]
- [".T" statement]
- [".T" eval])
+ (translation (jvm [".T" expression]
+ [".T" statement]
+ [".T" eval]))
[".L" eval])))
(exception: #export Invalid-Statement)
diff --git a/new-luxc/source/luxc/lang/host.jvm.lux b/new-luxc/source/luxc/lang/host.jvm.lux
index 6eb8aacbc..7ec0df535 100644
--- a/new-luxc/source/luxc/lang/host.jvm.lux
+++ b/new-luxc/source/luxc/lang/host.jvm.lux
@@ -14,7 +14,7 @@
[io])
(luxc ["&" lang]
(lang [".L" variable #+ Register]
- (translation [".T" common]))))
+ (translation (jvm [".T" common])))))
(host.import org/objectweb/asm/Label)
diff --git a/new-luxc/source/luxc/lang/macro.lux b/new-luxc/source/luxc/lang/macro.lux
index 71b140c6e..deebba0bf 100644
--- a/new-luxc/source/luxc/lang/macro.lux
+++ b/new-luxc/source/luxc/lang/macro.lux
@@ -5,7 +5,7 @@
[macro]
[host])
(luxc (lang [".L" host]
- (translation [".T" common]))))
+ (translation (jvm [".T" common])))))
(for {"JVM" (as-is (host.import java/lang/reflect/Method
(invoke [Object (Array Object)] #try Object))
diff --git a/new-luxc/source/luxc/lang/translation.lux b/new-luxc/source/luxc/lang/translation.lux
index 9a2b27122..cbd63b998 100644
--- a/new-luxc/source/luxc/lang/translation.lux
+++ b/new-luxc/source/luxc/lang/translation.lux
@@ -34,14 +34,13 @@
(analysis [".A" expression]
[".A" common])
(synthesis [".S" expression])
- (translation [".T" runtime]
- [".T" statement]
- [".T" common #+ Artifacts]
- [".T" expression]
- [".T" eval]
- [".T" imports])
- ["&." eval])
- ))
+ ["&." eval]))
+ (/ (jvm [".T" runtime]
+ [".T" statement]
+ [".T" common #+ Artifacts]
+ [".T" expression]
+ [".T" eval]
+ [".T" imports])))
(def: analyse
(&.Analyser)
diff --git a/new-luxc/source/luxc/lang/translation/case.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/case.jvm.lux
index b693f50b8..b693f50b8 100644
--- a/new-luxc/source/luxc/lang/translation/case.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/case.jvm.lux
diff --git a/new-luxc/source/luxc/lang/translation/common.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/common.jvm.lux
index a4eb5b93b..a4eb5b93b 100644
--- a/new-luxc/source/luxc/lang/translation/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/common.jvm.lux
diff --git a/new-luxc/source/luxc/lang/translation/eval.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/eval.jvm.lux
index 9cce16a49..c326895a2 100644
--- a/new-luxc/source/luxc/lang/translation/eval.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/eval.jvm.lux
@@ -11,9 +11,8 @@
["$d" def]
["$i" inst]))
["la" analysis]
- ["ls" synthesis]
- (translation [".T" common]))
- ))
+ ["ls" synthesis]))
+ (// [".T" common]))
(host.import java/lang/reflect/Field
(get [Object] Object))
diff --git a/new-luxc/source/luxc/lang/translation/expression.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/expression.jvm.lux
index 4496de784..82c8c0ec0 100644
--- a/new-luxc/source/luxc/lang/translation/expression.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/expression.jvm.lux
@@ -9,16 +9,17 @@
(macro ["s" syntax]))
(luxc ["&" lang]
(lang [".L" variable #+ Variable Register]
+ [".L" extension]
(host ["$" jvm])
- ["ls" synthesis]
- (translation [".T" common]
- [".T" primitive]
- [".T" structure]
- [".T" eval]
- [".T" procedure]
- [".T" function]
- [".T" reference]
- [".T" case]))))
+ ["ls" synthesis]))
+ (// [".T" common]
+ [".T" primitive]
+ [".T" structure]
+ [".T" eval]
+ [".T" function]
+ [".T" reference]
+ [".T" case]
+ [".T" procedure]))
(exception: #export Unrecognized-Synthesis)
@@ -70,6 +71,9 @@
(^code ((~ [_ (#.Text procedure)]) (~+ argsS)))
(procedureT.translate-procedure translate procedure argsS)
+ ## (do macro.Monad<Meta>
+ ## [translation (extensionL.find-translation procedure)]
+ ## (translation argsS))
_
(&.throw Unrecognized-Synthesis (%code synthesis))
diff --git a/new-luxc/source/luxc/lang/translation/function.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux
index 3070800fe..6fb446bc4 100644
--- a/new-luxc/source/luxc/lang/translation/function.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux
@@ -13,10 +13,10 @@
["$i" inst]))
["la" analysis]
["ls" synthesis]
- (translation [".T" common]
- [".T" runtime]
- [".T" reference])
- [".L" variable #+ Variable])))
+ [".L" variable #+ Variable]))
+ (// [".T" common]
+ [".T" runtime]
+ [".T" reference]))
(def: arity-field Text "arity")
diff --git a/new-luxc/source/luxc/lang/translation/imports.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/imports.jvm.lux
index 892dd869f..892dd869f 100644
--- a/new-luxc/source/luxc/lang/translation/imports.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/imports.jvm.lux
diff --git a/new-luxc/source/luxc/lang/translation/loop.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/loop.jvm.lux
index 8920dc936..2e585fb11 100644
--- a/new-luxc/source/luxc/lang/translation/loop.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/loop.jvm.lux
@@ -13,10 +13,10 @@
["$i" inst]))
["la" analysis]
["ls" synthesis]
- (translation [".T" common]
- [".T" runtime]
- [".T" reference])
- [".L" variable #+ Variable Register])))
+ [".L" variable #+ Variable Register]))
+ (// [".T" common]
+ [".T" runtime]
+ [".T" reference]))
(def: (constant? register changeS)
(-> Register ls.Synthesis Bool)
diff --git a/new-luxc/source/luxc/lang/translation/primitive.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/primitive.jvm.lux
index 8fed1de18..f92c7025a 100644
--- a/new-luxc/source/luxc/lang/translation/primitive.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/primitive.jvm.lux
@@ -9,8 +9,8 @@
(jvm ["$i" inst]
["$t" type]))
["la" analysis]
- ["ls" synthesis]
- (translation [".T" common]))))
+ ["ls" synthesis]))
+ (// [".T" common]))
(def: #export translate-unit
(Meta $.Inst)
diff --git a/new-luxc/source/luxc/lang/translation/procedure.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/procedure.jvm.lux
index e4f8b9908..e4f8b9908 100644
--- a/new-luxc/source/luxc/lang/translation/procedure.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/procedure.jvm.lux
diff --git a/new-luxc/source/luxc/lang/translation/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux
index 84c42244e..c7513fd6e 100644
--- a/new-luxc/source/luxc/lang/translation/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux
@@ -19,11 +19,11 @@
["$d" def]
["$i" inst]))
["la" analysis]
- ["ls" synthesis]
- (translation [".T" runtime]
- [".T" case]
- [".T" function]
- [".T" loop]))))
+ ["ls" synthesis]))
+ (/// [".T" runtime]
+ [".T" case]
+ [".T" function]
+ [".T" loop]))
(host.import java/lang/Long
(#static MIN_VALUE Long)
diff --git a/new-luxc/source/luxc/lang/translation/procedure/host.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/procedure/host.jvm.lux
index f737e81fc..30d17cac3 100644
--- a/new-luxc/source/luxc/lang/translation/procedure/host.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/procedure/host.jvm.lux
@@ -23,7 +23,7 @@
["la" analysis]
(extension (analysis ["&." host]))
["ls" synthesis]))
- ["@" //common])
+ (// ["@" common]))
(exception: #export Invalid-Syntax-For-JVM-Type)
(exception: #export Invalid-Syntax-For-Argument-Generation)
diff --git a/new-luxc/source/luxc/lang/translation/reference.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/reference.jvm.lux
index bfb5856d4..6776092c9 100644
--- a/new-luxc/source/luxc/lang/translation/reference.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/reference.jvm.lux
@@ -10,8 +10,8 @@
(jvm ["$t" type]
["$i" inst]))
["ls" synthesis]
- [".L" variable #+ Variable]
- (translation [".T" common]))))
+ [".L" variable #+ Variable]))
+ (// [".T" common]))
(do-template [<name> <prefix>]
[(def: #export (<name> idx)
diff --git a/new-luxc/source/luxc/lang/translation/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/runtime.jvm.lux
index df494a904..87a47f338 100644
--- a/new-luxc/source/luxc/lang/translation/runtime.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/runtime.jvm.lux
@@ -12,8 +12,8 @@
["$d" def]
["$i" inst]))
["la" analysis]
- ["ls" synthesis]
- (translation [".T" common]))))
+ ["ls" synthesis]))
+ (// [".T" common]))
(def: $Object $.Type ($t.class "java.lang.Object" (list)))
(def: $Object-Array $.Type ($t.array +1 $Object))
diff --git a/new-luxc/source/luxc/lang/translation/statement.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/statement.jvm.lux
index b2e302e1b..1b828535f 100644
--- a/new-luxc/source/luxc/lang/translation/statement.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/statement.jvm.lux
@@ -17,10 +17,10 @@
["$i" inst]))
["&." scope]
["&." module]
- [".L" host]
- (translation [".T" eval]
- [".T" common]
- [".T" runtime]))))
+ [".L" host]))
+ (// [".T" eval]
+ [".T" common]
+ [".T" runtime]))
(exception: #export Invalid-Definition-Value)
(exception: #export Cannot-Evaluate-Definition)
diff --git a/new-luxc/source/luxc/lang/translation/structure.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/structure.jvm.lux
index f7cdb524f..ddb6541cf 100644
--- a/new-luxc/source/luxc/lang/translation/structure.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/structure.jvm.lux
@@ -13,8 +13,8 @@
["$d" def]
["$i" inst]))
["la" analysis]
- ["ls" synthesis]
- (translation [".T" common]))))
+ ["ls" synthesis]))
+ (// [".T" common]))
(exception: #export Not-A-Tuple)
diff --git a/new-luxc/source/luxc/repl.lux b/new-luxc/source/luxc/repl.lux
index 717462f22..16f4de5db 100644
--- a/new-luxc/source/luxc/repl.lux
+++ b/new-luxc/source/luxc/repl.lux
@@ -34,7 +34,7 @@
[".L" host]
[".L" translation]
[".L" eval]
- (translation [".T" runtime])
+ (translation (jvm [".T" runtime]))
[".L" extension]
(extension [".E" analysis]
[".E" synthesis]