aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux.lux
diff options
context:
space:
mode:
authorEduardo Julian2020-04-20 23:56:15 -0400
committerEduardo Julian2020-04-20 23:56:15 -0400
commitf6a2fe158979230dcf2d271981ff34be39c7bffc (patch)
tree44e965c67bdf2b1bb9946fc3adcc123357c7b85f /stdlib/source/lux.lux
parent4428345ab84ed065193b8186e86474f496975569 (diff)
Added some testing machinery to measure the code coverage of tests.
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux.lux36
1 files changed, 18 insertions, 18 deletions
diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux
index c33f025ea..265b8e979 100644
--- a/stdlib/source/lux.lux
+++ b/stdlib/source/lux.lux
@@ -1456,16 +1456,6 @@
ys}
xs))
-(def:''' #export (splice-helper xs ys)
- #Nil
- (-> ($' List Code) ($' List Code) ($' List Code))
- ({(#Cons x xs')
- (#Cons x (splice-helper xs' ys))
-
- #Nil
- ys}
- xs))
-
(def:''' (_$_joiner op a1 a2)
#Nil
(-> Code Code Code Code)
@@ -1752,6 +1742,14 @@
(#Left ($_ text@compose "Unknown module: " module " @ " (name@encode full-name)))}
(get module modules))))
+(def:''' (as-code-list expression)
+ #Nil
+ (-> Code Code)
+ (let' [type (form$ (list (tag$ ["lux" "Apply"])
+ (identifier$ ["lux" "Code"])
+ (identifier$ ["lux" "List"])))]
+ (form$ (list (text$ "lux check") type expression))))
+
(def:''' (splice replace? untemplate elems)
#Nil
(-> Bit (-> Code ($' Meta Code)) ($' List Code) ($' Meta Code))
@@ -1762,21 +1760,21 @@
(#Cons lastI inits)
(do meta-monad
[lastO ({[_ (#Form (#Cons [[_ (#Identifier ["" "~+"])] (#Cons [spliced #Nil])]))]
- (let' [[[_module-name _ _] _] spliced]
- (wrap spliced))
+ (wrap (as-code-list spliced))
_
(do meta-monad
[lastO (untemplate lastI)]
- (wrap (form$ (list (tag$ ["lux" "Cons"]) (tuple$ (list lastO (tag$ ["lux" "Nil"])))))))}
+ (wrap (as-code-list (form$ (list (tag$ ["lux" "Cons"])
+ (tuple$ (list lastO (tag$ ["lux" "Nil"]))))))))}
lastI)]
(monad@fold meta-monad
(function' [leftI rightO]
({[_ (#Form (#Cons [[_ (#Identifier ["" "~+"])] (#Cons [spliced #Nil])]))]
- (let' [[[_module-name _ _] _] spliced]
- (wrap (form$ (list (identifier$ ["lux" "splice-helper"])
- spliced
- rightO))))
+ (let' [g!in-module (form$ (list (text$ "lux in-module")
+ (text$ "lux")
+ (identifier$ ["lux" "list@compose"])))]
+ (wrap (form$ (list g!in-module (as-code-list spliced) rightO))))
_
(do meta-monad
@@ -1847,7 +1845,9 @@
(return (wrap-meta (form$ (list (tag$ ["lux" "Identifier"]) (tuple$ (list (text$ module) (text$ name)))))))
[#1 [_ (#Form (#Cons [[_ (#Identifier ["" "~"])] (#Cons [unquoted #Nil])]))]]
- (return unquoted)
+ (return (form$ (list (text$ "lux check")
+ (identifier$ ["lux" "Code"])
+ unquoted)))
[#1 [_ (#Form (#Cons [[_ (#Identifier ["" "~!"])] (#Cons [dependent #Nil])]))]]
(do meta-monad