aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/meta/macro/syntax.lux
diff options
context:
space:
mode:
authorEduardo Julian2022-07-30 23:13:24 -0400
committerEduardo Julian2022-07-30 23:13:24 -0400
commit6ec8f5d2f6cbf8db45f91e5c4b48c6ec17659f72 (patch)
tree4af1db76b4aec333114f236bc88b9ccddc643e26 /stdlib/source/documentation/lux/meta/macro/syntax.lux
parent2d125c27e1ceb0adc14fd82f6984b70a12eda650 (diff)
Extracted test-tallying machinery into its own module.
Diffstat (limited to 'stdlib/source/documentation/lux/meta/macro/syntax.lux')
-rw-r--r--stdlib/source/documentation/lux/meta/macro/syntax.lux65
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
+ )
+ ))