aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/when.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/when.lux (renamed from stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/case.lux)24
1 files changed, 12 insertions, 12 deletions
diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/case.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/when.lux
index f8b30c1f9..7487beb55 100644
--- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/case.lux
+++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/when.lux
@@ -1,6 +1,6 @@
(.require
[library
- [lux (.except case exec let if)
+ [lux (.except when exec let if)
[abstract
["[0]" monad (.only do)]]
[control
@@ -25,7 +25,7 @@
["[1][0]" reference]
["/[1]" //
["[1][0]" synthesis
- ["[1]/[0]" case]]
+ ["[1]/[0]" when]]
["/[1]" //
["[1][0]" synthesis (.only Synthesis Path)
[access
@@ -158,7 +158,7 @@
(|> idx .int _.i32)))
(.if simple?
(_.when (_.= _.null @temp)
- ..fail_pm!)
+ ..fail_pm!)
(_.if (_.= _.null @temp)
..fail_pm!
(push_cursor! @temp)))))]
@@ -181,7 +181,7 @@
(def (optimized_pattern_matching again pathP)
(-> (-> Path (Operation Statement))
(-> Path (Operation (Maybe Statement))))
- (.case pathP
+ (.when pathP
(^.with_template [<simple> <choice>]
[(<simple> idx nextP)
(|> nextP
@@ -224,7 +224,7 @@
then!)}))
(/////synthesis.!multi_pop nextP)
- (.let [[extra_pops nextP'] (////synthesis/case.count_pops nextP)]
+ (.let [[extra_pops nextP'] (////synthesis/when.count_pops nextP)]
(do ///////phase.monad
[next! (again nextP')]
(in {.#Some (all _.then
@@ -240,12 +240,12 @@
(function (again pathP)
(do ///////phase.monad
[outcome (optimized_pattern_matching again pathP)]
- (.case outcome
+ (.when outcome
{.#Some outcome}
(in outcome)
{.#None}
- (.case pathP
+ (.when pathP
{/////synthesis.#Then bodyS}
(statement expression archive bodyS)
@@ -258,7 +258,7 @@
{/////synthesis.#Bit_Fork when thenP elseP}
(do [! ///////phase.monad]
[then! (again thenP)
- else! (.case elseP
+ else! (.when elseP
{.#Some elseP}
(again elseP)
@@ -326,9 +326,9 @@
(in (all _.then
(_.do_while (_.boolean false)
pattern_matching!)
- (_.throw (_.string ////synthesis/case.pattern_matching_error))))))
+ (_.throw (_.string ////synthesis/when.pattern_matching_error))))))
-(def .public (case! statement expression archive [valueS pathP])
+(def .public (when! statement expression archive [valueS pathP])
(Generator! [Synthesis Path])
(do ///////phase.monad
[stack_init (expression archive valueS)
@@ -339,8 +339,8 @@
(_.define @savepoint (_.array (list)))
pattern_matching!))))
-(def .public (case statement expression archive [valueS pathP])
+(def .public (when statement expression archive [valueS pathP])
(-> Phase! (Generator [Synthesis Path]))
(do ///////phase.monad
- [pattern_matching! (..case! statement expression archive [valueS pathP])]
+ [pattern_matching! (..when! statement expression archive [valueS pathP])]
(in (_.apply (_.closure (list) pattern_matching!) (list)))))