aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation.lux
diff options
context:
space:
mode:
Diffstat (limited to 'new-luxc/source/luxc/lang/translation.lux')
-rw-r--r--new-luxc/source/luxc/lang/translation.lux50
1 files changed, 25 insertions, 25 deletions
diff --git a/new-luxc/source/luxc/lang/translation.lux b/new-luxc/source/luxc/lang/translation.lux
index 1e631205d..9b59e5341 100644
--- a/new-luxc/source/luxc/lang/translation.lux
+++ b/new-luxc/source/luxc/lang/translation.lux
@@ -7,7 +7,7 @@
[text "text/" Hash<Text>]
text/format
(coll [dict]))
- [meta]
+ [macro]
(lang [syntax]
(type ["tc" check]))
[host]
@@ -39,7 +39,7 @@
(def: (process-annotations annsC)
(-> Code (Meta [$;Inst Code]))
- (do meta;Monad<Meta>
+ (do macro;Monad<Meta>
[[_ annsA] (&;with-scope
(&;with-type Code
(analyse annsC)))
@@ -53,10 +53,10 @@
(^code ("lux def" (~ [_ (#;Symbol ["" def-name])]) (~ valueC) (~ annsC)))
(hostL;with-context def-name
(&;with-fresh-type-env
- (do meta;Monad<Meta>
+ (do macro;Monad<Meta>
[[annsI annsV] (process-annotations annsC)
[_ valueT valueA] (&;with-scope
- (if (meta;type? (:! Code annsV))
+ (if (macro;type? (:! Code annsV))
(do @
[valueA (&;with-type Type
(analyse valueC))]
@@ -71,7 +71,7 @@
(wrap []))))
(^code ("lux program" (~ [_ (#;Symbol ["" program-args])]) (~ programC)))
- (do meta;Monad<Meta>
+ (do macro;Monad<Meta>
[[_ programA] (&;with-scope
(&;with-type (type (io;IO Unit))
(analyse programC)))
@@ -79,15 +79,15 @@
(statementT;translate-program program-args programI))
(^code ("lux module" (~ annsC)))
- (do meta;Monad<Meta>
+ (do macro;Monad<Meta>
[[annsI annsV] (process-annotations annsC)]
(&;fail (%code annsV)))
(^code ((~ [_ (#;Symbol macro-name)]) (~@ args)))
- (do meta;Monad<Meta>
- [macro-name (meta;normalize macro-name)
- [def-type def-anns def-value] (meta;find-def macro-name)]
- (if (meta;macro? def-anns)
+ (do macro;Monad<Meta>
+ [macro-name (macro;normalize macro-name)
+ [def-type def-anns def-value] (macro;find-def macro-name)]
+ (if (macro;macro? def-anns)
(do @
[expansion (function [compiler]
(case (macroH;expand (:! Macro def-value) args compiler)
@@ -119,7 +119,7 @@
(def: (with-active-compilation [module-name file-name source-code] action)
(All [a] (-> [Text Text Text] (Meta a) (Meta a)))
- (do meta;Monad<Meta>
+ (do macro;Monad<Meta>
[#let [init-cursor [file-name +1 +0]]
output (&;with-source-code [init-cursor +0 source-code]
action)
@@ -143,20 +143,20 @@
[_ (&io;prepare-module target-dir module-name)
[file-name file-content] (&io;read-module source-dirs module-name)
#let [module-hash (text/hash file-content)]]
- (case (meta;run' compiler
- (do meta;Monad<Meta>
- [[_ artifacts _] (moduleL;with-module module-hash module-name
- (commonT;with-artifacts
- (with-active-compilation [module-name
- file-name
- file-content]
- (exhaust
- (do @
- [code (parse module-name)
- #let [[cursor _] code]]
- (&;with-cursor cursor
- (translate code)))))))]
- (wrap artifacts)))
+ (case (macro;run' compiler
+ (do macro;Monad<Meta>
+ [[_ artifacts _] (moduleL;with-module module-hash module-name
+ (commonT;with-artifacts
+ (with-active-compilation [module-name
+ file-name
+ file-content]
+ (exhaust
+ (do @
+ [code (parse module-name)
+ #let [[cursor _] code]]
+ (&;with-cursor cursor
+ (translate code)))))))]
+ (wrap artifacts)))
(#e;Success [compiler artifacts])
(do @
[_ (monad;map @ (function [[class-name class-bytecode]]