diff options
author | Eduardo Julian | 2017-11-20 21:46:49 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-11-20 21:46:49 -0400 |
commit | 3eabc421e559e7e2f903e06eb6b47a2ee0cd25b9 (patch) | |
tree | e66ef551837cb895786bb532fe19e621132e81db /new-luxc/source/luxc/lang/analysis/expression.lux | |
parent | 4abfd5413b5a7aa540d7c06b387e3426ff5c532c (diff) |
- Added parallel compilation.
- Added aliasing.
- Several bug fixes.
- Some minor refactoring.
Diffstat (limited to 'new-luxc/source/luxc/lang/analysis/expression.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/analysis/expression.lux | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/new-luxc/source/luxc/lang/analysis/expression.lux b/new-luxc/source/luxc/lang/analysis/expression.lux index 5d38f7626..89fb3b93e 100644 --- a/new-luxc/source/luxc/lang/analysis/expression.lux +++ b/new-luxc/source/luxc/lang/analysis/expression.lux @@ -29,14 +29,14 @@ (def: #export (analyser eval) (-> &;Eval &;Analyser) (: (-> Code (Meta la;Analysis)) - (function analyse [ast] + (function analyse [code] (do macro;Monad<Meta> [expectedT macro;expected-type] - (let [[cursor ast'] ast] + (let [[cursor code'] code] ## The cursor must be set in the compiler for the sake ## of having useful error messages. (&;with-cursor cursor - (case ast' + (case code' (^template [<tag> <analyser>] (<tag> value) (<analyser> value)) @@ -83,16 +83,18 @@ (^ (#;Form (list& func args))) (do macro;Monad<Meta> - [[funcT =func] (commonA;with-unknown-type + [[funcT funcA] (commonA;with-unknown-type (analyse func))] - (case =func + (case funcA [_ (#;Symbol def-name)] (do @ - [[def-type def-anns def-value] (macro;find-def def-name)] - (if (macro;macro? def-anns) + [?macro (&;with-error-tracking + (macro;find-macro def-name))] + (case ?macro + (#;Some macro) (do @ [expansion (function [compiler] - (case (macroL;expand (:! Macro def-value) args compiler) + (case (macroL;expand macro args compiler) (#e;Success [compiler' output]) (#e;Success [compiler' output]) @@ -103,12 +105,14 @@ (analyse single) _ - (&;throw Macro-Expression-Must-Have-Single-Expansion (%code ast)))) - (functionA;analyse-apply analyse funcT =func args))) + (&;throw Macro-Expression-Must-Have-Single-Expansion (%code code)))) + + _ + (functionA;analyse-apply analyse funcT funcA args))) _ - (functionA;analyse-apply analyse funcT =func args))) + (functionA;analyse-apply analyse funcT funcA args))) _ - (&;throw Unrecognized-Syntax (%code ast)) + (&;throw Unrecognized-Syntax (%code code)) ))))))) |