From a8dacf2bd2b19e50888d3e5f293792d0b88afff7 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 19 Jun 2020 00:07:53 -0400 Subject: Optimizing tests for bit/i64/f64/text literals during pattern-matching. --- .../luxc/lang/translation/jvm/extension/host.lux | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux') 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 @@ ["" synthesis (#+ Parser)]]] [data ["." product] - ["." maybe] + ["." maybe ("#@." functor)] ["." text ("#@." equivalence) ["%" format (#+ format)]] [number @@ -830,9 +830,22 @@ (^ ( 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 [] + ( [[test then] elses]) + ( [[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) -- cgit v1.2.3