aboutsummaryrefslogtreecommitdiff
path: root/lux-jvm/source/luxc/lang/translation/jvm/extension
diff options
context:
space:
mode:
authorEduardo Julian2020-06-19 00:07:53 -0400
committerEduardo Julian2020-06-19 00:07:53 -0400
commita8dacf2bd2b19e50888d3e5f293792d0b88afff7 (patch)
treeaac846e3bf7ab3c5e2ce09e5dbb34f99b8434b66 /lux-jvm/source/luxc/lang/translation/jvm/extension
parent4138cd725e18c6ef55742f351af2adc59ff256c7 (diff)
Optimizing tests for bit/i64/f64/text literals during pattern-matching.
Diffstat (limited to 'lux-jvm/source/luxc/lang/translation/jvm/extension')
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux19
1 files changed, 16 insertions, 3 deletions
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
index 482521e34..c25151bcf 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
@@ -11,7 +11,7 @@
["<s>" synthesis (#+ Parser)]]]
[data
["." product]
- ["." maybe]
+ ["." maybe ("#@." functor)]
["." text ("#@." equivalence)
["%" format (#+ format)]]
[number
@@ -830,9 +830,22 @@
(^ (<tag> value))
path)
([#synthesis.Pop]
- [#synthesis.Test]
[#synthesis.Bind]
- [#synthesis.Access]))))
+ [#synthesis.Access])
+
+ (#synthesis.Bit-Fork when then else)
+ (#synthesis.Bit-Fork when (recur then) (maybe@map recur else))
+
+ (^template [<tag>]
+ (<tag> [[test then] elses])
+ (<tag> [[test (recur then)]
+ (list@map (function (_ [else-test else-then])
+ [else-test (recur else-then)])
+ elses)]))
+ ([#synthesis.I64-Fork]
+ [#synthesis.F64-Fork]
+ [#synthesis.Text-Fork])
+ )))
(def: (normalize-method-body mapping)
(-> (Dictionary Variable Variable) Synthesis Synthesis)