From ad729814254ec3fef8c75b59472bc8108ec7c4c7 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 17 Sep 2021 03:17:04 -0400 Subject: Handled the hiccup in Python compilation. --- stdlib/source/library/lux.lux | 45 +++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 17 deletions(-) (limited to 'stdlib/source/library/lux.lux') diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux index 3cf71545b..86a1cdce7 100644 --- a/stdlib/source/library/lux.lux +++ b/stdlib/source/library/lux.lux @@ -4079,22 +4079,6 @@ (~+ localizations) (~+ openings))))) -(macro: .public (using _imports) - (do meta_monad - [current_module current_module_name - imports (imports_parser #0 current_module {#End} _imports) - .let [=imports (|> imports - (list#each (: (-> Importation Code) - (function (_ [module_name m_alias =refer]) - (` [(~ (text$ module_name)) (~ (text$ (..maybe#else "" m_alias)))])))) - tuple$) - =refers (list#each (: (-> Importation Code) - (function (_ [module_name m_alias =refer]) - (refer_code module_name m_alias =refer))) - imports) - =module (` ("lux def module" (~ =imports)))]] - (in {#Item =module =refers}))) - (macro: .public (# tokens) (case tokens (^ (list struct [_ {#Symbol member}])) @@ -4823,6 +4807,31 @@ _ (failure (..wrong_syntax_error (symbol ..for)))))) +(macro: .public (using _imports) + (do meta_monad + [current_module current_module_name + imports (imports_parser #0 current_module {#End} _imports) + .let [=imports (|> imports + (list#each (: (-> Importation Code) + (function (_ [module_name m_alias =refer]) + (` [(~ (text$ module_name)) (~ (text$ (..maybe#else "" m_alias)))])))) + tuple$) + =refers (list#each (: (-> Importation Code) + (function (_ [module_name m_alias =refer]) + (refer_code module_name m_alias =refer))) + imports) + =module (` ("lux def module" (~ =imports)))] + g!_ (..generated_symbol "")] + (in {#Item =module + (for [... TODO: Remove this hack once Jython is no longer being used as the Python interpreter. + ... Without it, I get this strange error + ... {library/lux/tool/compiler/language/lux/generation.no_buffer_for_saving_code} + ... Artifact ID: 0 + ... Which only ever happens for the Python compiler. + "Python" (list& (` ("lux def" (~ g!_) [] #0)) + =refers)] + =refers)}))) + (def: (embedded_expansions code) (-> Code (Meta [(List [Code Code]) Code])) (case code @@ -4977,7 +4986,9 @@ (def: (methodP tokens) (-> (List Code) (Maybe [(List Code) [Text Code]])) (case tokens - (^ (list& [_ {#Form (list [_ {#Text "lux type check"}] type [_ {#Symbol ["" name]}])}] + (^ (list& [_ {#Form (list [_ {#Text "lux type check"}] + type + [_ {#Symbol ["" name]}])}] tokens')) {#Some [tokens' [name type]]} -- cgit v1.2.3