diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/documentation/lux/meta/macro/syntax.lux | 65 |
1 files changed, 35 insertions, 30 deletions
diff --git a/stdlib/source/documentation/lux/meta/macro/syntax.lux b/stdlib/source/documentation/lux/meta/macro/syntax.lux index 4e3001f3f..4f924ea38 100644 --- a/stdlib/source/documentation/lux/meta/macro/syntax.lux +++ b/stdlib/source/documentation/lux/meta/macro/syntax.lux @@ -1,12 +1,12 @@ (.require [library - [lux (.except char) + [lux (.except) ["$" documentation] [data [text (.only \n) ["%" \\format (.only format)]] [collection - ["[0]" list]]]]] + ["[0]" list (.use "[1]#[0]" monoid)]]]]] ["[0]" / ["[1][0]" check] ["[1][0]" declaration] @@ -18,31 +18,36 @@ [\\library ["[0]" /]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.syntax - (format \n "A more advanced way to define macros than 'macro'." - \n "The inputs to the macro can be parsed in complex ways through the use of syntax parsers." - \n "The macro body is also (implicitly) run in the Meta monad, to save some typing." - \n "Also, the compiler state can be accessed through a special binding.") - [(def .public object - (syntax (_ lux_state [.let [imports (class_imports lux_state)] - .let [class_vars (list)] - super (opt (super_class_decl^ imports class_vars)) - interfaces (tuple (some (super_class_decl^ imports class_vars))) - constructor_args (constructor_args^ imports class_vars) - methods (some (overriden_method_def^ imports))]) - (let [def_code (all text#composite "anon-class:" - (spaced (list (super_class_decl$ (maybe.else object_super_class super)) - (with_brackets (spaced (list#each super_class_decl$ interfaces))) - (with_brackets (spaced (list#each constructor_arg$ constructor_args))) - (with_brackets (spaced (list#each (method_def$ id) methods))))))] - (in (list (` ((, (code.text def_code)))))))))])] - [/check.documentation - /declaration.documentation - /definition.documentation - /export.documentation - /input.documentation - /type/variable.documentation])) +(def .public documentation + (List $.Documentation) + (list.partial ($.module /._ + "") + + ($.definition /.syntax + (format \n "A more advanced way to define macros than 'macro'." + \n "The inputs to the macro can be parsed in complex ways through the use of syntax parsers." + \n "The macro body is also (implicitly) run in the Meta monad, to save some typing." + \n "Also, the compiler state can be accessed through a special binding.") + [(def .public object + (syntax (_ lux_state [.let [imports (class_imports lux_state)] + .let [class_vars (list)] + super (opt (super_class_decl^ imports class_vars)) + interfaces (tuple (some (super_class_decl^ imports class_vars))) + constructor_args (constructor_args^ imports class_vars) + methods (some (overriden_method_def^ imports))]) + (let [def_code (all text#composite "anon-class:" + (spaced (list (super_class_decl$ (maybe.else object_super_class super)) + (with_brackets (spaced (list#each super_class_decl$ interfaces))) + (with_brackets (spaced (list#each constructor_arg$ constructor_args))) + (with_brackets (spaced (list#each (method_def$ id) methods))))))] + (in (list (` ((, (code.text def_code)))))))))]) + + (all list#composite + /check.documentation + /declaration.documentation + /definition.documentation + /export.documentation + /input.documentation + /type/variable.documentation + ) + )) |