diff options
Diffstat (limited to 'stdlib/source/lux/macro/syntax/common/reader.lux')
-rw-r--r-- | stdlib/source/lux/macro/syntax/common/reader.lux | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/stdlib/source/lux/macro/syntax/common/reader.lux b/stdlib/source/lux/macro/syntax/common/reader.lux index fcf9ce0d0..cd7ca1dce 100644 --- a/stdlib/source/lux/macro/syntax/common/reader.lux +++ b/stdlib/source/lux/macro/syntax/common/reader.lux @@ -14,52 +14,7 @@ ["." meta]] ["." //]) -(def: (flat_list^ _) - (-> Any (Parser (List Code))) - (p.either (do p.monad - [_ (s.tag! (name_of #.Nil))] - (wrap (list))) - (s.form (do p.monad - [_ (s.tag! (name_of #.Cons)) - [head tail] (s.tuple (p.and s.any s.any)) - tail (s.local (list tail) (flat_list^ []))] - (wrap (#.Cons head tail)))))) - -(template [<name> <type> <tag> <then>] - [(def: <name> - (Parser <type>) - (<| s.tuple - (p.after s.any) - s.form - (do p.monad - [_ (s.tag! (name_of <tag>))] - <then>)))] - - [tuple_meta^ (List Code) #.Tuple (flat_list^ [])] - [text_meta^ Text #.Text s.text] - ) - -(def: (find_definition_args meta_data) - (-> (List [Name Code]) (List Text)) - (<| (maybe.default (list)) - (: (Maybe (List Text))) - (case (list.find (|>> product.left (name\= ["lux" "func-args"])) meta_data) - (^multi (#.Some [_ value]) - [(p.run tuple_meta^ (list value)) - (#.Right [_ args])] - [(p.run (p.some text_meta^) args) - (#.Right [_ args])]) - (#.Some args) - - _ - #.None))) - (def: #export typed_input {#.doc "Reader for the common typed-argument syntax used by many macros."} (Parser //.Typed_Input) (s.record (p.and s.any s.any))) - -(def: #export type_variables - {#.doc "Reader for the common type var/param used by many macros."} - (Parser (List Text)) - (p.some s.local_identifier)) |