(.module: [library [lux "*" ["_" test {"+" [Test]}] ["[0]" meta] [control ["[0]" try] ["[0]" exception] [parser ["<[0]>" code]]] [data ["[0]" text ("[1]\[0]" equivalence) ["%" format]] [format ["md" markdown]]] ["[0]" macro [syntax {"+" [syntax:]}] ["[0]" template] ["[0]" code]]]] [\\library ["[0]" /]]) (syntax: (macro_error [macro .any]) (function (_ compiler) (#try.Success [compiler (list (code.bit (case ((macro.expansion macro) compiler) (#try.Failure error) true (#try.Success _) false)))]))) (syntax: (description []) (\ meta.monad each (|>> %.nat code.text list) meta.seed)) (template.with_locals [g!default] (with_expansions ['definition_description' (..description) 'sub_description' (..description) 'super_description' (..description)] (as_is (def: .public g!default Nat 123) (/.documentation: /.documentation: 'definition_description') (def: .public test Test (<| (_.covering /._) ($_ _.and (_.for [/.Definition] ($_ _.and (_.cover [/.default] (case (`` (/.default (~~ (template.identifier [.._] [g!default])))) (^ (list definition)) (and (|> definition (value@ #/.definition) (text\= (template.text [g!default]))) (|> definition (value@ #/.documentation) md.markdown (text\= "") not)) _ false)) (_.cover [/.documentation:] (case ..documentation: (^ (list documentation:)) (and (|> documentation: (value@ #/.definition) (text\= (template.text [/.documentation:]))) (|> documentation: (value@ #/.documentation) md.markdown (text.contains? 'definition_description'))) _ false)) )) (_.for [/.Module] ($_ _.and (_.cover [/.module /.documentation] (let [sub (`` (/.module /._ (~~ (template.text ['sub_description'])) [] [])) super (`` (/.module .._ (~~ (template.text ['super_description'])) [..documentation:] [sub]))] (and (text.contains? (template.text ['sub_description']) (/.documentation sub)) (text.contains? (/.documentation sub) (/.documentation super)) (text.contains? (template.text ['super_description']) (/.documentation super)) (case ..documentation: (^ (list documentation:)) (text.contains? (md.markdown (value@ #/.documentation documentation:)) (/.documentation super)) _ false)))) )) (_.cover [/.unqualified_identifier] (`` (and (~~ (template [] [(macro_error )] [(/.default g!default)] [(/.documentation: g!default (~~ (template.text ['definition_description'])))] [(/.module g!default "" [..documentation:] [sub])] ))))) ))))) )