aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/language/compiler/analysis/expression.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/language/compiler/analysis/expression.lux57
1 files changed, 27 insertions, 30 deletions
diff --git a/stdlib/source/lux/language/compiler/analysis/expression.lux b/stdlib/source/lux/language/compiler/analysis/expression.lux
index f6ec5d11a..1c5c8794c 100644
--- a/stdlib/source/lux/language/compiler/analysis/expression.lux
+++ b/stdlib/source/lux/language/compiler/analysis/expression.lux
@@ -9,16 +9,16 @@
[text
format]]
[macro]]
- [//// (#+ Eval)
- ## [".L" macro]
- ## [".L" extension]
- ]
- [///]
- [// (#+ Analysis Operation Compiler)]
- [//type]
- [//primitive]
- [//structure]
- [//reference])
+ ["." ///
+ [extension]]
+ [// (#+ Analysis Operation Compiler)
+ [type]
+ [primitive]
+ [structure]
+ [reference]
+ ["/." /// (#+ Eval)
+ ## [".L" macro]
+ ]])
(exception: #export (macro-expansion-failed {message Text})
message)
@@ -35,7 +35,7 @@
(-> Eval Compiler)
(function (compile code)
(do ///.Monad<Operation>
- [expectedT macro.expected-type]
+ [expectedT (extension.lift macro.expected-type)]
(let [[cursor code'] code]
## The cursor must be set in the compiler for the sake
## of having useful error messages.
@@ -44,12 +44,12 @@
(^template [<tag> <analyser>]
(<tag> value)
(<analyser> value))
- ([#.Bool //primitive.bool]
- [#.Nat //primitive.nat]
- [#.Int //primitive.int]
- [#.Rev //primitive.rev]
- [#.Frac //primitive.frac]
- [#.Text //primitive.text])
+ ([#.Bool primitive.bool]
+ [#.Nat primitive.nat]
+ [#.Int primitive.int]
+ [#.Rev primitive.rev]
+ [#.Frac primitive.frac]
+ [#.Text primitive.text])
(^template [<tag> <analyser>]
(^ (#.Form (list& [_ (<tag> tag)]
@@ -60,42 +60,39 @@
_
(<analyser> compile tag (` [(~+ values)]))))
- ([#.Nat //structure.sum]
- [#.Tag //structure.tagged-sum])
+ ([#.Nat structure.sum]
+ [#.Tag structure.tagged-sum])
(#.Tag tag)
- (//structure.tagged-sum compile tag (' []))
+ (structure.tagged-sum compile tag (' []))
(^ (#.Tuple (list)))
- //primitive.unit
+ primitive.unit
(^ (#.Tuple (list singleton)))
(compile singleton)
(^ (#.Tuple elems))
- (//structure.product compile elems)
+ (structure.product compile elems)
(^ (#.Record pairs))
- (//structure.record compile pairs)
+ (structure.record compile pairs)
(#.Symbol reference)
- (//reference.reference reference)
+ (reference.reference reference)
(^ (#.Form (list& [_ (#.Text extension-name)] extension-args)))
- (undefined)
- ## (do ///.Monad<Operation>
- ## [extension (extensionL.find-analysis extension-name)]
- ## (extension compile eval extension-args))
+ (extension.apply compile [extension-name extension-args])
## (^ (#.Form (list& func args)))
## (do ///.Monad<Operation>
- ## [[funcT funcA] (//type.with-inference
+ ## [[funcT funcA] (type.with-inference
## (compile func))]
## (case funcA
## [_ (#.Symbol def-name)]
## (do @
## [?macro (///.with-error-tracking
- ## (macro.find-macro def-name))]
+ ## (extension.lift (macro.find-macro def-name)))]
## (case ?macro
## (#.Some macro)
## (do @