diff options
author | Eduardo Julian | 2017-11-29 22:49:56 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-11-29 22:49:56 -0400 |
commit | 4433c9bcd6c6cac44c018aad2e21a5b4d7cc4896 (patch) | |
tree | 0c166db6e01b41dfadd01801b5242967f2363b7d /new-luxc/source/luxc/lang/analysis.lux | |
parent | 77c113a3455cdbc4bb485a94f67f392480cdcfbf (diff) |
- Adapted main codebase to the latest syntatic changes.
Diffstat (limited to 'new-luxc/source/luxc/lang/analysis.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/analysis.lux | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/new-luxc/source/luxc/lang/analysis.lux b/new-luxc/source/luxc/lang/analysis.lux index f6163feb1..107d4979e 100644 --- a/new-luxc/source/luxc/lang/analysis.lux +++ b/new-luxc/source/luxc/lang/analysis.lux @@ -1,9 +1,9 @@ -(;module: +(.module: lux (lux [function] (data (coll [list "list/" Fold<List>])) (macro [code])) - (luxc (lang [";L" variable #+ Variable]))) + (luxc (lang [".L" variable #+ Variable]))) (type: #export Pattern Code) @@ -28,23 +28,23 @@ (def: #export (sum tag size temp value) (-> Nat Nat Nat Analysis Analysis) - (if (n.= (n.dec size) tag) - (if (n.= +1 tag) + (if (n/= (n/dec size) tag) + (if (n/= +1 tag) (sum-right value) - (list/fold (function;const sum-left) + (list/fold (function.const sum-left) (sum-right value) - (list;n.range +0 (n.- +2 tag)))) - (list/fold (function;const sum-left) + (list.n/range +0 (n/- +2 tag)))) + (list/fold (function.const sum-left) (case value (^or (^code ("lux sum left" (~ inner))) (^code ("lux sum right" (~ inner)))) (` ("lux case" (~ value) - {("lux case bind" (~ (code;nat temp))) - ((~ (code;int (local-variable temp))))})) + {("lux case bind" (~ (code.nat temp))) + ((~ (code.int (local-variable temp))))})) _ value) - (list;n.range +0 tag)))) + (list.n/range +0 tag)))) ## Tuples get analysed into binary products for the sake of semantic ## simplicity, since products/pairs can encode tuples of any length @@ -53,13 +53,13 @@ (def: #export (product members) (-> (List Analysis) Analysis) (case members - #;Nil + #.Nil (` []) - (#;Cons singleton #;Nil) + (#.Cons singleton #.Nil) singleton - (#;Cons left right) + (#.Cons left right) (` [(~ left) (~ (product right))]))) ## Function application gets analysed into single-argument @@ -75,17 +75,17 @@ (def: #export (procedure name args) (-> Text (List Analysis) Analysis) - (` ((~ (code;text name)) (~@ args)))) + (` ((~ (code.text name)) (~@ args)))) (def: #export (var idx) (-> Variable Analysis) - (` ((~ (code;int idx))))) + (` ((~ (code.int idx))))) (def: #export (unfold-tuple analysis) (-> Analysis (List Analysis)) (case analysis (^code [(~ left) (~ right)]) - (#;Cons left (unfold-tuple right)) + (#.Cons left (unfold-tuple right)) _ (list analysis))) @@ -99,13 +99,13 @@ (case valueA (^or (^code ("lux sum left" (~ _))) (^code ("lux sum right" (~ _)))) - (recur (n.inc so-far) valueA) + (recur (n/inc so-far) valueA) _ - (#;Some [so-far false valueA])) + (#.Some [so-far false valueA])) (^code ("lux sum right" (~ valueA))) - (#;Some [(n.inc so-far) true valueA]) + (#.Some [(n/inc so-far) true valueA]) _ - #;None))) + #.None))) |