From bbf78668e9ae2fb3deb78217ae97791df89ada56 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 30 May 2017 19:42:20 -0400 Subject: - Some refactoring. --- new-luxc/source/luxc/analyser/structure.lux | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'new-luxc/source/luxc/analyser/structure.lux') diff --git a/new-luxc/source/luxc/analyser/structure.lux b/new-luxc/source/luxc/analyser/structure.lux index ab6f6adae..9447ea059 100644 --- a/new-luxc/source/luxc/analyser/structure.lux +++ b/new-luxc/source/luxc/analyser/structure.lux @@ -18,8 +18,7 @@ [type] (type ["TC" check])) (luxc ["&" base] - (lang ["la" analysis #+ Analysis] - ["lp" pattern]) + (lang ["la" analysis]) ["&;" module] ["&;" env] (analyser ["&;" common] @@ -27,7 +26,7 @@ ## [Analysers] (def: (analyse-typed-product analyse members) - (-> &;Analyser (List Code) (Lux Analysis)) + (-> &;Analyser (List Code) (Lux la;Analysis)) (do Monad [expected macro;expected-type] (loop [expected expected @@ -109,7 +108,7 @@ (:: Monad wrap [(list) Unit]))) (def: (tuple members) - (-> (List Analysis) Analysis) + (-> (List la;Analysis) la;Analysis) (case members #;Nil #la;Unit @@ -121,7 +120,7 @@ (#la;Product left (tuple right)))) (def: #export (analyse-product analyse membersC) - (-> &;Analyser (List Code) (Lux Analysis)) + (-> &;Analyser (List Code) (Lux la;Analysis)) (do Monad [expected macro;expected-type] (&;with-stacked-errors @@ -244,7 +243,7 @@ (&;fail (format "Not a variant type: " (%type type))))) (def: #export (analyse-record analyse members) - (-> &;Analyser (List [Code Code]) (Lux Analysis)) + (-> &;Analyser (List [Code Code]) (Lux la;Analysis)) (do Monad [members (normalize-record members) [members recordT] (order-record members) @@ -257,14 +256,14 @@ (do-template [ ] [(def: ( inner) - (-> Analysis Analysis) + (-> la;Analysis la;Analysis) (#la;Sum ( inner)))] [sum-left #;Left] [sum-right #;Right]) (def: (variant tag size temp value) - (-> Nat Nat Nat Analysis Analysis) + (-> Nat Nat Nat la;Analysis la;Analysis) (if (n.= (n.dec size) tag) (if (n.= +1 tag) (sum-right value) @@ -274,7 +273,7 @@ (L/fold (function;const sum-left) (case value (#la;Sum _) - (#la;Case value (list [(#lp;Bind temp) + (#la;Case value (list [(#la;BindP temp) (#la;Relative (#;Local temp))])) _ @@ -282,7 +281,7 @@ (list;n.range +0 tag)))) (def: #export (analyse-tagged-sum analyse tag value) - (-> &;Analyser Ident Code (Lux Analysis)) + (-> &;Analyser Ident Code (Lux la;Analysis)) (do Monad [tag (macro;normalize tag) [idx group variantT] (macro;resolve-tag tag) @@ -296,7 +295,7 @@ (wrap (variant idx case-size temp (|> valueA+ list;head assume))))) (def: #export (analyse-sum analyse tag valueC) - (-> &;Analyser Nat Code (Lux Analysis)) + (-> &;Analyser Nat Code (Lux la;Analysis)) (do Monad [expected macro;expected-type] (&;with-stacked-errors -- cgit v1.2.3