diff options
author | Eduardo Julian | 2018-07-10 23:54:36 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-07-10 23:54:36 -0400 |
commit | 5efe74b9eba910d5389e20be07b504b1dad69504 (patch) | |
tree | de6240f98e5eb6a9a5c8a6dc827ea739c9cb11c9 /stdlib/source/lux.lux | |
parent | 852410fda71621522f7707a80554140a5aac7f9c (diff) |
- Improvements to import syntax [part 0].
Diffstat (limited to 'stdlib/source/lux.lux')
-rw-r--r-- | stdlib/source/lux.lux | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux index 71cdbe716..4710b022b 100644 --- a/stdlib/source/lux.lux +++ b/stdlib/source/lux.lux @@ -4112,38 +4112,18 @@ _ (return [#Nothing tokens]))) -(def: (split-with' p ys xs) - (All [a] - (-> (-> a Bool) (List a) (List a) [(List a) (List a)])) - (case xs - #Nil - [ys xs] - - (#Cons x xs') - (if (p x) - (split-with' p (list& x ys) xs') - [ys xs]))) - -(def: (split-with p xs) - (All [a] - (-> (-> a Bool) (List a) [(List a) (List a)])) - (let [[ys' xs'] (split-with' p #Nil xs)] - [(list/reverse ys') xs'])) - (def: (parse-short-referrals tokens) (-> (List Code) (Meta [Referrals (List Code)])) (case tokens - (^ (list& [_ (#Tag "" "+")] tokens')) - (let [[defs tokens'] (split-with symbol? tokens')] - (do Monad<Meta> - [defs' (extract-defs defs)] - (return [(#Only defs') tokens']))) + (^ (list& [_ (#Form (list& [_ (#Tag "" "+")] defs))] tokens')) + (do Monad<Meta> + [defs' (extract-defs defs)] + (return [(#Only defs') tokens'])) - (^ (list& [_ (#Tag "" "-")] tokens')) - (let [[defs tokens'] (split-with symbol? tokens')] - (do Monad<Meta> - [defs' (extract-defs defs)] - (return [(#Exclude defs') tokens']))) + (^ (list& [_ (#Form (list& [_ (#Tag "" "-")] defs))] tokens')) + (do Monad<Meta> + [defs' (extract-defs defs)] + (return [(#Exclude defs') tokens'])) (^ (list& [_ (#Tag "" "*")] tokens')) (return [#All tokens']) |