From 0e34448e5c0ffd9c39d67c2f859e91942e1ab0a4 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 2 Jun 2022 13:56:01 -0400 Subject: Extensible import syntax [Part 3] --- stdlib/source/library/lux.lux | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) (limited to 'stdlib/source/library/lux.lux') diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux index f8a0d5bb9..ec325459b 100644 --- a/stdlib/source/library/lux.lux +++ b/stdlib/source/library/lux.lux @@ -3377,7 +3377,6 @@ (type: Referrals (Variant - {#All} {#Ignore} {#Nothing} {#Referral [Symbol (List Code)]})) @@ -3403,10 +3402,6 @@ (meta#in [{#Referral [macro defs]} tokens']) - (pattern#or (pattern (partial_list [_ {#Text "*"}] tokens')) - (pattern (partial_list [_ {#Text "all"}] tokens'))) - (meta#in [{#All} tokens']) - (pattern#or (pattern (partial_list [_ {#Text "_"}] tokens')) (pattern (partial_list [_ {#Text "ignore"}] tokens'))) (meta#in [{#Ignore} tokens']) @@ -3559,15 +3554,6 @@ (is (-> Code (Meta (List Importation))) (function (_ token) (case token - ... Simple - [_ {#Symbol ["" module_name]}] - (do meta_monad - [absolute_module_name (..absolute_module_name nested? relative_root module_name)] - (in (list [#import_name absolute_module_name - #import_alias {#None} - #import_refer [#refer_defs {#All} - #refer_open (list)]]))) - ... Nested (pattern [_ {#Tuple (partial_list [_ {#Symbol ["" module_name]}] extra)}]) (do meta_monad @@ -3776,6 +3762,17 @@ {.#None} (failure (..wrong_syntax_error (symbol ..except))))) +(macro: .public (full tokens) + (case (..parsed (all ..andP + ..anyP + ..anyP) + tokens) + {.#Some [current_module imported_module]} + (meta#in (list (` (..except (~ current_module) (~ imported_module))))) + + {.#None} + (failure (..wrong_syntax_error (symbol ..full))))) + (def: (in_env name state) (-> Text Lux (Maybe Type)) (case state @@ -4171,12 +4168,6 @@ (failure (all text#composite _def " is not defined in module " module_name " @ " current_module))))) referred_defs)))] defs (case r_defs - {#All} - (do meta_monad - [*defs (exported_definitions module_name)] - (in (list#each (alias_definition module_name) - *defs))) - {#Ignore} (in (list)) @@ -4212,9 +4203,6 @@ (let [module_alias (..maybe#else module_name module_alias') localizations (is (List Code) (case r_defs - {#All} - (list (' "*")) - {#Ignore} (list) -- cgit v1.2.3