aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/test
diff options
context:
space:
mode:
authorEduardo Julian2018-04-18 01:28:24 -0400
committerEduardo Julian2018-04-18 01:28:24 -0400
commit7d539a83fd55f7ced7657302054e099955b55ae2 (patch)
tree6aa50f8d58d87da48880569ed2f748e8bc014243 /new-luxc/test
parent6eb9cf17f161522d4eddf6783284952f8a84f099 (diff)
- Initial Scheme back-end implementation.
Diffstat (limited to '')
-rw-r--r--new-luxc/test/test/luxc/common.lux89
-rw-r--r--new-luxc/test/test/luxc/lang/translation/case.lux47
-rw-r--r--new-luxc/test/test/luxc/lang/translation/common.lux38
-rw-r--r--new-luxc/test/test/luxc/lang/translation/function.lux38
-rw-r--r--new-luxc/test/test/luxc/lang/translation/primitive.lux38
-rw-r--r--new-luxc/test/test/luxc/lang/translation/reference.lux49
-rw-r--r--new-luxc/test/test/luxc/lang/translation/structure.lux39
7 files changed, 181 insertions, 157 deletions
diff --git a/new-luxc/test/test/luxc/common.lux b/new-luxc/test/test/luxc/common.lux
index 7d4b156b8..35ec86c1b 100644
--- a/new-luxc/test/test/luxc/common.lux
+++ b/new-luxc/test/test/luxc/common.lux
@@ -14,31 +14,36 @@
[".T_jvm" eval]
[".T_jvm" runtime]
[".T_jvm" statement])
- [js]
- (js [".T_js" expression]
- [".T_js" eval]
- [".T_js" runtime]
- [".T_js" statement])
- [lua]
- (lua [".T_lua" expression]
- [".T_lua" eval]
- [".T_lua" runtime]
- [".T_lua" statement])
- [ruby]
- (ruby [".T_ruby" expression]
- [".T_ruby" eval]
- [".T_ruby" runtime]
- [".T_ruby" statement])
- [python]
- (python [".T_python" expression]
- [".T_python" eval]
- [".T_python" runtime]
- [".T_python" statement])
- [r]
- (r [".T_r" expression]
- [".T_r" eval]
- [".T_r" runtime]
- [".T_r" statement])
+ ## [js]
+ ## (js [".T_js" expression]
+ ## [".T_js" eval]
+ ## [".T_js" runtime]
+ ## [".T_js" statement])
+ ## [lua]
+ ## (lua [".T_lua" expression]
+ ## [".T_lua" eval]
+ ## [".T_lua" runtime]
+ ## [".T_lua" statement])
+ ## [ruby]
+ ## (ruby [".T_ruby" expression]
+ ## [".T_ruby" eval]
+ ## [".T_ruby" runtime]
+ ## [".T_ruby" statement])
+ ## [python]
+ ## (python [".T_python" expression]
+ ## [".T_python" eval]
+ ## [".T_python" runtime]
+ ## [".T_python" statement])
+ ## [r]
+ ## (r [".T_r" expression]
+ ## [".T_r" eval]
+ ## [".T_r" runtime]
+ ## [".T_r" statement])
+ [scheme]
+ (scheme [".T_scheme" expression]
+ [".T_scheme" eval]
+ [".T_scheme" runtime]
+ [".T_scheme" statement])
))))
(type: #export Runner (-> Synthesis (e.Error Top)))
@@ -52,11 +57,12 @@
(wrap (initL.compiler host))))]
[init-jvm &host.init-host]
- [init-js js.init]
- [init-lua lua.init]
- [init-ruby ruby.init]
- [init-python python.init]
- [init-r r.init]
+ ## [init-js js.init]
+ ## [init-lua lua.init]
+ ## [init-ruby ruby.init]
+ ## [init-python python.init]
+ ## [init-r r.init]
+ [init-scheme scheme.init]
)
(def: (runner translate-runtime translate-expression eval init)
@@ -88,17 +94,20 @@
(def: #export run-jvm (runner runtimeT_jvm.translate expressionT_jvm.translate evalT_jvm.eval init-jvm))
(def: #export def-jvm (definer runtimeT_jvm.translate expressionT_jvm.translate evalT_jvm.eval init-jvm statementT_jvm.translate-def))
-(def: #export run-js (runner runtimeT_js.translate expressionT_js.translate evalT_js.eval init-js))
-(def: #export def-js (definer runtimeT_js.translate expressionT_js.translate evalT_js.eval init-js statementT_js.translate-def))
+## (def: #export run-js (runner runtimeT_js.translate expressionT_js.translate evalT_js.eval init-js))
+## (def: #export def-js (definer runtimeT_js.translate expressionT_js.translate evalT_js.eval init-js statementT_js.translate-def))
-(def: #export run-lua (runner runtimeT_lua.translate expressionT_lua.translate evalT_lua.eval init-lua))
-(def: #export def-lua (definer runtimeT_lua.translate expressionT_lua.translate evalT_lua.eval init-lua statementT_lua.translate-def))
+## (def: #export run-lua (runner runtimeT_lua.translate expressionT_lua.translate evalT_lua.eval init-lua))
+## (def: #export def-lua (definer runtimeT_lua.translate expressionT_lua.translate evalT_lua.eval init-lua statementT_lua.translate-def))
-(def: #export run-ruby (runner runtimeT_ruby.translate expressionT_ruby.translate evalT_ruby.eval init-ruby))
-(def: #export def-ruby (definer runtimeT_ruby.translate expressionT_ruby.translate evalT_ruby.eval init-ruby statementT_ruby.translate-def))
+## (def: #export run-ruby (runner runtimeT_ruby.translate expressionT_ruby.translate evalT_ruby.eval init-ruby))
+## (def: #export def-ruby (definer runtimeT_ruby.translate expressionT_ruby.translate evalT_ruby.eval init-ruby statementT_ruby.translate-def))
-(def: #export run-python (runner runtimeT_python.translate expressionT_python.translate evalT_python.eval init-python))
-(def: #export def-python (definer runtimeT_python.translate expressionT_python.translate evalT_python.eval init-python statementT_python.translate-def))
+## (def: #export run-python (runner runtimeT_python.translate expressionT_python.translate evalT_python.eval init-python))
+## (def: #export def-python (definer runtimeT_python.translate expressionT_python.translate evalT_python.eval init-python statementT_python.translate-def))
-(def: #export run-r (runner runtimeT_r.translate expressionT_r.translate evalT_r.eval init-r))
-(def: #export def-r (definer runtimeT_r.translate expressionT_r.translate evalT_r.eval init-r statementT_r.translate-def))
+## (def: #export run-r (runner runtimeT_r.translate expressionT_r.translate evalT_r.eval init-r))
+## (def: #export def-r (definer runtimeT_r.translate expressionT_r.translate evalT_r.eval init-r statementT_r.translate-def))
+
+(def: #export run-scheme (runner runtimeT_scheme.translate expressionT_scheme.translate evalT_scheme.eval init-scheme))
+(def: #export def-scheme (definer runtimeT_scheme.translate expressionT_scheme.translate evalT_scheme.eval init-scheme statementT_scheme.translate-def))
diff --git a/new-luxc/test/test/luxc/lang/translation/case.lux b/new-luxc/test/test/luxc/lang/translation/case.lux
index dc198b633..75736d223 100644
--- a/new-luxc/test/test/luxc/lang/translation/case.lux
+++ b/new-luxc/test/test/luxc/lang/translation/case.lux
@@ -94,37 +94,32 @@
(#e.Error error)
(exec (log! error)
- false))))
- (test "Can translate \"let\" expressions."
- (|> (run (` ("lux let" +0 (~ (code.nat to-bind))
- (0))))
- (case> (#e.Success valueT)
- (n/= to-bind (:! Nat valueT))
-
- (#e.Error error)
- (exec (log! error)
false)))))))
-(context: "[JVM] Pattern-matching."
- (<| (times +100)
- (pattern-matching-spec run-jvm)))
+## (context: "[JVM] Pattern-matching."
+## (<| (times +100)
+## (pattern-matching-spec run-jvm)))
-(context: "[JS] Pattern-matching."
- (<| (times +100)
- (pattern-matching-spec run-js)))
+## (context: "[JS] Pattern-matching."
+## (<| (times +100)
+## (pattern-matching-spec run-js)))
-(context: "[Lua] Pattern-matching."
- (<| (times +100)
- (pattern-matching-spec run-lua)))
+## (context: "[Lua] Pattern-matching."
+## (<| (times +100)
+## (pattern-matching-spec run-lua)))
-(context: "[Ruby] Pattern-matching."
- (<| (times +100)
- (pattern-matching-spec run-ruby)))
+## (context: "[Ruby] Pattern-matching."
+## (<| (times +100)
+## (pattern-matching-spec run-ruby)))
-(context: "[Python] Function."
- (<| (times +100)
- (pattern-matching-spec run-python)))
+## (context: "[Python] Function."
+## (<| (times +100)
+## (pattern-matching-spec run-python)))
+
+## (context: "[R] Pattern-matching."
+## (<| (times +100)
+## (pattern-matching-spec run-r)))
-(context: "[R] Pattern-matching."
+(context: "[Scheme] Function."
(<| (times +100)
- (pattern-matching-spec run-r)))
+ (pattern-matching-spec run-scheme)))
diff --git a/new-luxc/test/test/luxc/lang/translation/common.lux b/new-luxc/test/test/luxc/lang/translation/common.lux
index 4ab1b879d..8734336aa 100644
--- a/new-luxc/test/test/luxc/lang/translation/common.lux
+++ b/new-luxc/test/test/luxc/lang/translation/common.lux
@@ -737,26 +737,30 @@
(process-spec run)
))
-(context: "[JVM] Common procedures."
- (<| (times +100)
- (all-specs run-jvm)))
+## (context: "[JVM] Common procedures."
+## (<| (times +100)
+## (all-specs run-jvm)))
-(context: "[JS] Common procedures."
- (<| (times +100)
- (all-specs run-js)))
+## (context: "[JS] Common procedures."
+## (<| (times +100)
+## (all-specs run-js)))
-(context: "[Lua] Common procedures."
- (<| (times +100)
- (all-specs run-lua)))
+## (context: "[Lua] Common procedures."
+## (<| (times +100)
+## (all-specs run-lua)))
-(context: "[Ruby] Common procedures."
- (<| (times +100)
- (all-specs run-ruby)))
+## (context: "[Ruby] Common procedures."
+## (<| (times +100)
+## (all-specs run-ruby)))
-(context: "[Python] Common procedures."
- (<| (times +100)
- (all-specs run-python)))
+## (context: "[Python] Common procedures."
+## (<| (times +100)
+## (all-specs run-python)))
+
+## (context: "[R] Common procedures."
+## (<| (times +100)
+## (all-specs run-r)))
-(context: "[R] Common procedures."
+(context: "[Scheme] Common procedures."
(<| (times +100)
- (all-specs run-r)))
+ (all-specs run-scheme)))
diff --git a/new-luxc/test/test/luxc/lang/translation/function.lux b/new-luxc/test/test/luxc/lang/translation/function.lux
index b0baaaa03..0a3d8ca62 100644
--- a/new-luxc/test/test/luxc/lang/translation/function.lux
+++ b/new-luxc/test/test/luxc/lang/translation/function.lux
@@ -87,26 +87,30 @@
false))))))
)))
-(context: "[JVM] Function."
- (<| (times +100)
- (function-spec run-jvm)))
+## (context: "[JVM] Function."
+## (<| (times +100)
+## (function-spec run-jvm)))
-(context: "[JS] Function."
- (<| (times +100)
- (function-spec run-js)))
+## (context: "[JS] Function."
+## (<| (times +100)
+## (function-spec run-js)))
-(context: "[Lua] Function."
- (<| (times +100)
- (function-spec run-lua)))
+## (context: "[Lua] Function."
+## (<| (times +100)
+## (function-spec run-lua)))
-(context: "[Ruby] Function."
- (<| (times +100)
- (function-spec run-ruby)))
+## (context: "[Ruby] Function."
+## (<| (times +100)
+## (function-spec run-ruby)))
-(context: "[Python] Function."
- (<| (times +100)
- (function-spec run-python)))
+## (context: "[Python] Function."
+## (<| (times +100)
+## (function-spec run-python)))
+
+## (context: "[R] Function."
+## (<| (times +100)
+## (function-spec run-r)))
-(context: "[R] Function."
+(context: "[Scheme] Function."
(<| (times +100)
- (function-spec run-r)))
+ (function-spec run-scheme)))
diff --git a/new-luxc/test/test/luxc/lang/translation/primitive.lux b/new-luxc/test/test/luxc/lang/translation/primitive.lux
index d410f29f0..d36a02eb7 100644
--- a/new-luxc/test/test/luxc/lang/translation/primitive.lux
+++ b/new-luxc/test/test/luxc/lang/translation/primitive.lux
@@ -56,26 +56,30 @@
["text" Text code.text %text% text/=]))
))))
-(context: "[JVM] Primitives."
- (<| (times +100)
- (spec run-jvm)))
+## (context: "[JVM] Primitives."
+## (<| (times +100)
+## (spec run-jvm)))
-(context: "[JS] Primitives."
- (<| (times +100)
- (spec run-js)))
+## (context: "[JS] Primitives."
+## (<| (times +100)
+## (spec run-js)))
-(context: "[Lua] Primitives."
- (<| (times +100)
- (spec run-lua)))
+## (context: "[Lua] Primitives."
+## (<| (times +100)
+## (spec run-lua)))
-(context: "[Ruby] Primitives."
- (<| (times +100)
- (spec run-ruby)))
+## (context: "[Ruby] Primitives."
+## (<| (times +100)
+## (spec run-ruby)))
-(context: "[Python] Primitives."
- (<| (times +100)
- (spec run-python)))
+## (context: "[Python] Primitives."
+## (<| (times +100)
+## (spec run-python)))
+
+## (context: "[R] Primitives."
+## (<| (times +100)
+## (spec run-r)))
-(context: "[R] Primitives."
+(context: "[Scheme] Primitives."
(<| (times +100)
- (spec run-r)))
+ (spec run-scheme)))
diff --git a/new-luxc/test/test/luxc/lang/translation/reference.lux b/new-luxc/test/test/luxc/lang/translation/reference.lux
index 6f27b75f2..7cef493e6 100644
--- a/new-luxc/test/test/luxc/lang/translation/reference.lux
+++ b/new-luxc/test/test/luxc/lang/translation/reference.lux
@@ -13,11 +13,12 @@
(lang ["_." module]
["ls" synthesis]
(translation (jvm [".T_jvm" statement])
- (js [".T_js" statement])
- (lua [".T_lua" statement])
- (ruby [".T_ruby" statement])
- (python [".T_python" statement])
- (r [".T_r" statement]))))
+ ## (js [".T_js" statement])
+ ## (lua [".T_lua" statement])
+ ## (ruby [".T_ruby" statement])
+ ## (python [".T_python" statement])
+ ## (r [".T_r" statement])
+ (scheme [".T_scheme" statement]))))
(test/luxc common))
(def: upper-alpha-ascii
@@ -67,26 +68,30 @@
(seq (definitions-spec define)
(variables-spec run)))
-(context: "[JVM] References."
- (<| (times +100)
- (references-spec run-jvm def-jvm)))
+## (context: "[JVM] References."
+## (<| (times +100)
+## (references-spec run-jvm def-jvm)))
-(context: "[JS] References."
- (<| (times +100)
- (references-spec run-js def-js)))
+## (context: "[JS] References."
+## (<| (times +100)
+## (references-spec run-js def-js)))
-(context: "[Lua] References."
- (<| (times +100)
- (references-spec run-lua def-lua)))
+## (context: "[Lua] References."
+## (<| (times +100)
+## (references-spec run-lua def-lua)))
-(context: "[Ruby] References."
- (<| (times +100)
- (references-spec run-ruby def-ruby)))
+## (context: "[Ruby] References."
+## (<| (times +100)
+## (references-spec run-ruby def-ruby)))
-(context: "[Python] References."
- (<| (times +100)
- (references-spec run-python def-python)))
+## (context: "[Python] References."
+## (<| (times +100)
+## (references-spec run-python def-python)))
+
+## (context: "[R] References."
+## (<| (times +100)
+## (references-spec run-r def-r)))
-(context: "[R] References."
+(context: "[Scheme] References."
(<| (times +100)
- (references-spec run-r def-r)))
+ (references-spec run-scheme def-scheme)))
diff --git a/new-luxc/test/test/luxc/lang/translation/structure.lux b/new-luxc/test/test/luxc/lang/translation/structure.lux
index cf186364c..5f2439394 100644
--- a/new-luxc/test/test/luxc/lang/translation/structure.lux
+++ b/new-luxc/test/test/luxc/lang/translation/structure.lux
@@ -21,7 +21,6 @@
(test/luxc common))
(host.import java/lang/Integer)
-(host.import java/lang/Long)
(def: upper-alpha
(r.Random Nat)
@@ -115,26 +114,30 @@
(tuples-spec run)
(variants-spec run)))
-(context: "[JVM] Structures."
- (<| (times +100)
- (structure-spec run-jvm)))
+## (context: "[JVM] Structures."
+## (<| (times +100)
+## (structure-spec run-jvm)))
-(context: "[JS] Structures."
- (<| (times +100)
- (structure-spec run-js)))
+## (context: "[JS] Structures."
+## (<| (times +100)
+## (structure-spec run-js)))
-(context: "[Lua] Structures."
- (<| (times +100)
- (structure-spec run-lua)))
+## (context: "[Lua] Structures."
+## (<| (times +100)
+## (structure-spec run-lua)))
-(context: "[Ruby] Structures."
- (<| (times +100)
- (structure-spec run-ruby)))
+## (context: "[Ruby] Structures."
+## (<| (times +100)
+## (structure-spec run-ruby)))
-(context: "[Python] Structures."
- (<| (times +100)
- (structure-spec run-python)))
+## (context: "[Python] Structures."
+## (<| (times +100)
+## (structure-spec run-python)))
+
+## (context: "[R] Structures."
+## (<| (times +100)
+## (structure-spec run-r)))
-(context: "[R] Structures."
+(context: "[Scheme] Structures."
(<| (times +100)
- (structure-spec run-r)))
+ (structure-spec run-scheme)))