aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux.lux
diff options
context:
space:
mode:
authorEduardo Julian2021-09-17 03:17:04 -0400
committerEduardo Julian2021-09-17 03:17:04 -0400
commitad729814254ec3fef8c75b59472bc8108ec7c4c7 (patch)
tree72e717376d80466dd568565712e88cfa1545a3a8 /stdlib/source/library/lux.lux
parent5fdf2b62f1f97026f76c0336a225f8b510762b46 (diff)
Handled the hiccup in Python compilation.
Diffstat (limited to 'stdlib/source/library/lux.lux')
-rw-r--r--stdlib/source/library/lux.lux45
1 files changed, 28 insertions, 17 deletions
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]]}