diff options
Diffstat (limited to 'stdlib/source/lux/compiler/default.lux')
-rw-r--r-- | stdlib/source/lux/compiler/default.lux | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/stdlib/source/lux/compiler/default.lux b/stdlib/source/lux/compiler/default.lux index 2b8aeb0a8..e799f0496 100644 --- a/stdlib/source/lux/compiler/default.lux +++ b/stdlib/source/lux/compiler/default.lux @@ -15,7 +15,7 @@ ["." macro] [world ["." file (#+ File)]]] - [// + ["." // (#+ Source) ["." cli (#+ Configuration)] [meta [io @@ -36,9 +36,6 @@ ## [cache/io]) ) -(exception: #export (cannot-compile-module {name Text}) - (ex.report ["Module" name])) - (type: Reader (-> .Source (Error [.Source Code]))) @@ -78,13 +75,9 @@ #runtime (translation.Operation anchor expression statement Any) #file-system (file.System !)}) -(type: #export Source - {#name Text - #code Text}) - (with-expansions [<Platform> (as-is (Platform ! anchor expression statement)) <Operation> (as-is (statement.Operation anchor expression statement Any)) - <Compiler> (as-is (statement.State+ anchor expression statement)) + <State+> (as-is (statement.State+ anchor expression statement)) <Bundle> (as-is (Bundle anchor expression statement))] (def: (begin-module-compilation module-name source) @@ -92,9 +85,9 @@ (-> Text Source <Operation>)) (statement.lift-analysis (do phase.Monad<Operation> - [_ (module.create (text/hash (get@ #code source)) module-name) + [_ (module.create (text/hash (get@ #//.code source)) module-name) _ (analysis.set-current-module module-name)] - (analysis.set-source-code (init.source (get@ #name source) (get@ #code source)))))) + (analysis.set-source-code (init.source (get@ #//.name source) (get@ #//.code source)))))) (def: end-module-compilation (All [anchor expression statement] @@ -125,7 +118,7 @@ (#error.Error error) (if (ex.match? syntax.end-of-file error) (#error.Success [state []]) - (ex.with-stack ..cannot-compile-module module-name (#error.Error error)))))))) + (ex.with-stack //.cannot-compile module-name (#error.Error error)))))))) (def: (perform-module-compilation module-name source) (All [anchor expression statement] @@ -137,7 +130,7 @@ (def: #export (compile-module platform configuration compiler) (All [! anchor expression statement] - (-> <Platform> Configuration <Compiler> (! <Compiler>))) + (-> <Platform> Configuration <State+> (! <State+>))) (do (:: (get@ #file-system platform) &monad) [source (context.read (get@ #file-system platform) (get@ #cli.sources configuration) @@ -156,7 +149,7 @@ (def: #export (initialize platform configuration translation-bundle) (All [! anchor expression statement] - (-> <Platform> Configuration <Bundle> (! <Compiler>))) + (-> <Platform> Configuration <Bundle> (! <State+>))) (|> platform (get@ #runtime) statement.lift-translation |