From 19c589edc2c1dd77550e26d4f5cf78ec772da337 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 31 Oct 2017 22:26:13 -0400 Subject: - Migrated the format of analysis nodes from a custom data-type, to just Code nodes. --- new-luxc/source/luxc/synthesizer/case.lux | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'new-luxc/source/luxc/synthesizer/case.lux') diff --git a/new-luxc/source/luxc/synthesizer/case.lux b/new-luxc/source/luxc/synthesizer/case.lux index 91f339bdf..15cb6eca3 100644 --- a/new-luxc/source/luxc/synthesizer/case.lux +++ b/new-luxc/source/luxc/synthesizer/case.lux @@ -6,26 +6,12 @@ (coll [list "list/" Fold])) (meta [code "code/" Eq])) (luxc (lang ["la" analysis] - ["ls" synthesis]) - (synthesizer ["&;" function]))) + ["ls" synthesis]))) (def: #export (path pattern) (-> la;Pattern ls;Path) (case pattern - (#la;BindP register) - (` ("lux case bind" (~ (code;nat register)))) - - (^template [ ] - ( value) - ( value)) - ([#la;BoolP code;bool] - [#la;NatP code;nat] - [#la;IntP code;int] - [#la;DegP code;deg] - [#la;FracP code;frac] - [#la;TextP code;text]) - - (#la;TupleP membersP) + (^code [(~@ membersP)]) (case (list;reverse membersP) #;Nil (' ("lux case pop")) @@ -45,11 +31,14 @@ (` ("lux case tuple right" (~ (code;nat last-idx)) (~ (path lastP))))] prevsP)] tuple-path)) - - (#la;VariantP tag num-tags memberP) + + (^code ((~ [_ (#;Nat tag)]) (~ [_ (#;Nat num-tags)]) (~ memberP))) (if (n.= (n.dec num-tags) tag) (` ("lux case variant right" (~ (code;nat tag)) (~ (path memberP)))) - (` ("lux case variant left" (~ (code;nat tag)) (~ (path memberP))))))) + (` ("lux case variant left" (~ (code;nat tag)) (~ (path memberP))))) + + _ + pattern)) (def: #export (weave leftP rightP) (-> ls;Path ls;Path ls;Path) -- cgit v1.2.3