diff options
author | Eduardo Julian | 2017-05-30 19:42:20 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-05-30 19:42:20 -0400 |
commit | bbf78668e9ae2fb3deb78217ae97791df89ada56 (patch) | |
tree | b6767b688d87c820d80fc8c54b0a352142d0fcbe /new-luxc/source/luxc/analyser/structure.lux | |
parent | 953f49d5a46209f2d75e67b50edea378261108cd (diff) |
- Some refactoring.
Diffstat (limited to 'new-luxc/source/luxc/analyser/structure.lux')
-rw-r--r-- | new-luxc/source/luxc/analyser/structure.lux | 21 |
1 files changed, 10 insertions, 11 deletions
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<Lux> [expected macro;expected-type] (loop [expected expected @@ -109,7 +108,7 @@ (:: Monad<Lux> 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<Lux> [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<Lux> [members (normalize-record members) [members recordT] (order-record members) @@ -257,14 +256,14 @@ (do-template [<name> <side>] [(def: (<name> inner) - (-> Analysis Analysis) + (-> la;Analysis la;Analysis) (#la;Sum (<side> 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<Lux> [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<Lux> [expected macro;expected-type] (&;with-stacked-errors |