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/expression.lux | |
parent | 77c113a3455cdbc4bb485a94f67f392480cdcfbf (diff) |
- Adapted main codebase to the latest syntatic changes.
Diffstat (limited to 'new-luxc/source/luxc/lang/analysis/expression.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/analysis/expression.lux | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/new-luxc/source/luxc/lang/analysis/expression.lux b/new-luxc/source/luxc/lang/analysis/expression.lux index b16499c01..0f3cdcf6e 100644 --- a/new-luxc/source/luxc/lang/analysis/expression.lux +++ b/new-luxc/source/luxc/lang/analysis/expression.lux @@ -1,4 +1,4 @@ -(;module: +(.module: lux (lux (control [monad #+ do] ["ex" exception #+ exception:]) @@ -10,94 +10,94 @@ (type ["tc" check])) [host]) (luxc ["&" lang] - (lang ["&;" module] - [";L" host] - [";L" macro] + (lang ["&." module] + [".L" host] + [".L" macro] ["la" analysis] - (translation [";T" common]))) - (// [";A" common] - [";A" function] - [";A" primitive] - [";A" reference] - [";A" structure] - [";A" procedure])) + (translation [".T" common]))) + (// [".A" common] + [".A" function] + [".A" primitive] + [".A" reference] + [".A" structure] + [".A" procedure])) (exception: #export Macro-Expression-Must-Have-Single-Expansion) (exception: #export Unrecognized-Syntax) (exception: #export Macro-Expansion-Failed) (def: #export (analyser eval) - (-> &;Eval &;Analyser) - (: (-> Code (Meta la;Analysis)) + (-> &.Eval &.Analyser) + (: (-> Code (Meta la.Analysis)) (function analyse [code] - (do macro;Monad<Meta> - [expectedT macro;expected-type] + (do macro.Monad<Meta> + [expectedT macro.expected-type] (let [[cursor code'] code] ## The cursor must be set in the compiler for the sake ## of having useful error messages. - (&;with-cursor cursor + (&.with-cursor cursor (case code' (^template [<tag> <analyser>] (<tag> value) (<analyser> value)) - ([#;Bool primitiveA;analyse-bool] - [#;Nat primitiveA;analyse-nat] - [#;Int primitiveA;analyse-int] - [#;Deg primitiveA;analyse-deg] - [#;Frac primitiveA;analyse-frac] - [#;Text primitiveA;analyse-text]) + ([#.Bool primitiveA.analyse-bool] + [#.Nat primitiveA.analyse-nat] + [#.Int primitiveA.analyse-int] + [#.Deg primitiveA.analyse-deg] + [#.Frac primitiveA.analyse-frac] + [#.Text primitiveA.analyse-text]) - (^ (#;Tuple (list))) - primitiveA;analyse-unit + (^ (#.Tuple (list))) + primitiveA.analyse-unit ## Singleton tuples are equivalent to the element they contain. - (^ (#;Tuple (list singleton))) + (^ (#.Tuple (list singleton))) (analyse singleton) - (^ (#;Tuple elems)) - (structureA;analyse-product analyse elems) + (^ (#.Tuple elems)) + (structureA.analyse-product analyse elems) - (^ (#;Record pairs)) - (structureA;analyse-record analyse pairs) + (^ (#.Record pairs)) + (structureA.analyse-record analyse pairs) - (#;Symbol reference) - (referenceA;analyse-reference reference) + (#.Symbol reference) + (referenceA.analyse-reference reference) - (^ (#;Form (list& [_ (#;Text proc-name)] proc-args))) - (procedureA;analyse-procedure analyse eval proc-name proc-args) + (^ (#.Form (list& [_ (#.Text proc-name)] proc-args))) + (procedureA.analyse-procedure analyse eval proc-name proc-args) (^template [<tag> <analyser>] - (^ (#;Form (list& [_ (<tag> tag)] + (^ (#.Form (list& [_ (<tag> tag)] values))) (case values - (#;Cons value #;Nil) + (#.Cons value #.Nil) (<analyser> analyse tag value) _ (<analyser> analyse tag (` [(~@ values)])))) - ([#;Nat structureA;analyse-sum] - [#;Tag structureA;analyse-tagged-sum]) + ([#.Nat structureA.analyse-sum] + [#.Tag structureA.analyse-tagged-sum]) - (#;Tag tag) - (structureA;analyse-tagged-sum analyse tag (' [])) + (#.Tag tag) + (structureA.analyse-tagged-sum analyse tag (' [])) - (^ (#;Form (list& func args))) - (do macro;Monad<Meta> - [[funcT funcA] (commonA;with-unknown-type + (^ (#.Form (list& func args))) + (do macro.Monad<Meta> + [[funcT funcA] (commonA.with-unknown-type (analyse func))] (case funcA - [_ (#;Symbol def-name)] + [_ (#.Symbol def-name)] (do @ - [?macro (&;with-error-tracking - (macro;find-macro def-name))] + [?macro (&.with-error-tracking + (macro.find-macro def-name))] (case ?macro - (#;Some macro) + (#.Some macro) (do @ [expansion (: (Meta (List Code)) (function [compiler] - (case (macroL;expand macro args compiler) - (#e;Error error) - ((&;throw Macro-Expansion-Failed error) compiler) + (case (macroL.expand macro args compiler) + (#e.Error error) + ((&.throw Macro-Expansion-Failed error) compiler) output output)))] @@ -106,14 +106,14 @@ (analyse single) _ - (&;throw Macro-Expression-Must-Have-Single-Expansion (%code code)))) + (&.throw Macro-Expression-Must-Have-Single-Expansion (%code code)))) _ - (functionA;analyse-apply analyse funcT funcA args))) + (functionA.analyse-apply analyse funcT funcA args))) _ - (functionA;analyse-apply analyse funcT funcA args))) + (functionA.analyse-apply analyse funcT funcA args))) _ - (&;throw Unrecognized-Syntax (%code code)) + (&.throw Unrecognized-Syntax (%code code)) ))))))) |