From e5594faf0c38c5d85eb15c1305a124b220c9f428 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 13 Dec 2017 08:24:56 -0500 Subject: - Added CLI machinery to compiler. - Added extensions to the REPL. --- new-luxc/source/luxc/lang/translation.lux | 15 ++++++++------- new-luxc/source/luxc/repl.lux | 13 ++++++++++++- 2 files changed, 20 insertions(+), 8 deletions(-) (limited to 'new-luxc/source/luxc') diff --git a/new-luxc/source/luxc/lang/translation.lux b/new-luxc/source/luxc/lang/translation.lux index b1e65c952..1a8ae9be0 100644 --- a/new-luxc/source/luxc/lang/translation.lux +++ b/new-luxc/source/luxc/lang/translation.lux @@ -254,13 +254,14 @@ _ (&io.write target (format hostL.runtime-class ".class") runtime-bc) _ (&io.write target (format hostL.function-class ".class") function-bc) _ (cache/io.pre-load sources target (commonT.load-definition compiler))] - (wrap (set@ #.extensions - (:! Void - {#extensionL.analysis analysisE.defaults - #extensionL.synthesis synthesisE.defaults - #extensionL.translation translationE.defaults - #extensionL.statement statementE.defaults}) - compiler)))))] + (wrap (|> compiler + (set@ [#.info #.mode] #.Build) + (set@ #.extensions + (:! Void + {#extensionL.analysis analysisE.defaults + #extensionL.synthesis synthesisE.defaults + #extensionL.translation translationE.defaults + #extensionL.statement statementE.defaults})))))))] (translate-module sources target prelude compiler))) (def: #export (translate-program sources target program) diff --git a/new-luxc/source/luxc/repl.lux b/new-luxc/source/luxc/repl.lux index 466446003..717462f22 100644 --- a/new-luxc/source/luxc/repl.lux +++ b/new-luxc/source/luxc/repl.lux @@ -34,7 +34,12 @@ [".L" host] [".L" translation] [".L" eval] - (translation [".T" runtime])))) + (translation [".T" runtime]) + [".L" extension] + (extension [".E" analysis] + [".E" synthesis] + [".E" translation] + [".E" statement])))) (exception: #export REPL-Initialization-Failed) (exception: #export REPL-Error) @@ -55,6 +60,12 @@ (#e.Success [compiler _]) (|> compiler (set@ [#.info #.mode] #.REPL) + (set@ #.extensions + (:! Void + {#extensionL.analysis analysisE.defaults + #extensionL.synthesis synthesisE.defaults + #extensionL.translation translationE.defaults + #extensionL.statement statementE.defaults})) (translationL.translate-module source-dirs target-dir translationL.prelude)) (#e.Error error) -- cgit v1.2.3