From cd71a864ad5be13ed6ec6d046e0a2cb1087bdf94 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 10 Sep 2021 01:21:23 -0400 Subject: Migrated variants to the new syntax. --- .../specification/compositor/generation/case.lux | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'stdlib/source/specification/compositor/generation/case.lux') diff --git a/stdlib/source/specification/compositor/generation/case.lux b/stdlib/source/specification/compositor/generation/case.lux index d699aa74b..eb27aea29 100644 --- a/stdlib/source/specification/compositor/generation/case.lux +++ b/stdlib/source/specification/compositor/generation/case.lux @@ -40,10 +40,10 @@ (def: .public (verify expected) (-> Frac (Try Any) Bit) - (|>> (case> (#try.Success actual) + (|>> (case> {#try.Success actual} (f.= expected (:as Frac actual)) - (#try.Failure _) + {#try.Failure _} false))) (def: case @@ -187,11 +187,11 @@ (def: special_path Path - (let [_end_ (synthesis.path/side (#.Left 0)) - _item_ (synthesis.path/side (#.Right 0)) - _head_ (synthesis.path/member (#.Left 0)) - _tail_ (synthesis.path/member (#.Right 0)) - _tuple_ (synthesis.path/side (#.Left 9))] + (let [_end_ (synthesis.path/side {#.Left 0}) + _item_ (synthesis.path/side {#.Right 0}) + _head_ (synthesis.path/member {#.Left 0}) + _tail_ (synthesis.path/member {#.Right 0}) + _tuple_ (synthesis.path/side {#.Left 9})] ($_ synthesis.path/alt ($_ synthesis.path/seq _item_ @@ -213,18 +213,18 @@ (def: special_pattern analysis.Pattern - (let [... [_ (#Tuple (#Item arg args'))] + (let [... [_ {#Tuple {#Item arg args'}}] head (<| analysis.pattern/tuple (list (analysis.pattern/bind 2)) analysis.pattern/variant [9 #0] analysis.pattern/variant [0 #1] analysis.pattern/tuple (list (analysis.pattern/bind 3) (analysis.pattern/bind 4))) - ... (#Item body #End) + ... {#Item body #End} tail (<| analysis.pattern/variant [0 #1] analysis.pattern/tuple (list (analysis.pattern/bind 5)) analysis.pattern/variant [0 #0] (analysis.pattern/unit))] - ... (#Item ) + ... {#Item } (<| analysis.pattern/variant [0 #1] (analysis.pattern/tuple (list head tail))))) @@ -253,28 +253,28 @@ (_.test "CODE" (|> special_input (run "special_input") - (case> (#try.Success output) + (case> {#try.Success output} true - (#try.Failure _) + {#try.Failure _} false))) (_.test "PATTERN_MATCHING 0" (|> (synthesis.branch/case [special_input special_path]) (run "special_path") - (case> (#try.Success output) + (case> {#try.Success output} true - (#try.Failure _) + {#try.Failure _} false))) (_.test "PATTERN_MATCHING 1" (|> (synthesis.branch/case [special_input special_pattern_path]) (run "special_pattern_path") - (case> (#try.Success output) + (case> {#try.Success output} true - (#try.Failure _) + {#try.Failure _} false))) )) -- cgit v1.2.3