aboutsummaryrefslogtreecommitdiff
path: root/lux-bootstrapper/src/lux/optimizer.clj
diff options
context:
space:
mode:
authorEduardo Julian2020-12-11 22:40:31 -0400
committerEduardo Julian2020-12-11 22:40:31 -0400
commitdff517cbdb9a1c80028782c62ad91c71ddb34909 (patch)
treef69b4005e8b6dc9699a410554ce4571f60d9e0ee /lux-bootstrapper/src/lux/optimizer.clj
parent9af671a34728b35c48bff2ba163c371dc5084946 (diff)
Improved parsing speed for Lux code.
Diffstat (limited to '')
-rw-r--r--lux-bootstrapper/src/lux/optimizer.clj17
1 files changed, 15 insertions, 2 deletions
diff --git a/lux-bootstrapper/src/lux/optimizer.clj b/lux-bootstrapper/src/lux/optimizer.clj
index 6e235e084..c8c8af02f 100644
--- a/lux-bootstrapper/src/lux/optimizer.clj
+++ b/lux-bootstrapper/src/lux/optimizer.clj
@@ -813,6 +813,14 @@
($ann _value-expr _type-expr)
(&/T [meta ($ann (optimize-iter arity _value-expr) _type-expr)])
+ ($proc ["lux" "syntax char case!"] (&/$Cons ?input (&/$Cons ?else ?matches)) ?special-args)
+ (&/T [meta ($proc (&/T ["lux" "syntax char case!"])
+ (&/$Cons ?input
+ (&/$Cons (optimize-iter arity ?else)
+ (&/|map (partial optimize-iter arity)
+ ?matches)))
+ ?special-args)])
+
_
optim
)))
@@ -850,6 +858,11 @@
(or (contains-self-reference? func)
(&/fold stepwise-test false args))
+ ($proc ["lux" "syntax char case!"] (&/$Cons ?input (&/$Cons ?else ?matches)) ?special-args)
+ (or (contains-self-reference? ?input)
+ (contains-self-reference? ?else)
+ (&/fold stepwise-test false ?matches))
+
($proc proc-ident args special-args)
(&/fold stepwise-test false args)
@@ -871,7 +884,7 @@
(or (contains-self-reference? _test)
(contains-self-reference? _then)
(contains-self-reference? _else))
-
+
_
false
)))
@@ -946,7 +959,7 @@
(&/|map (partial loop-transform register-offset direct?) args))])
;; Captured-vars are ignored because they'll be handled properly at shift-function-body
-
+
($proc proc-ident args special-args)
(&/T [meta ($proc proc-ident (&/|map (partial loop-transform register-offset direct?) args) special-args)])