diff options
Diffstat (limited to 'stdlib/source/documentation/lux/control/parser.lux')
-rw-r--r-- | stdlib/source/documentation/lux/control/parser.lux | 209 |
1 files changed, 91 insertions, 118 deletions
diff --git a/stdlib/source/documentation/lux/control/parser.lux b/stdlib/source/documentation/lux/control/parser.lux index b20bb433f..426854632 100644 --- a/stdlib/source/documentation/lux/control/parser.lux +++ b/stdlib/source/documentation/lux/control/parser.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except or and not) - ["$" documentation (.only documentation:)] + ["$" documentation] [data [text (.only \n) ["%" \\format (.only format)]]] @@ -22,149 +22,122 @@ ["[1][0]" type] ["[1][0]" xml]]) -(documentation: (/.Parser state it) - "A generic parser.") - -(documentation: /.assertion - "Fails with the given message if the test is #0." - [(assertion message test)]) +(.def .public documentation + (.List $.Module) + ($.module /._ + "" + [($.default /.functor) + ($.default /.apply) + ($.default /.monad) -(documentation: /.maybe - "Optionality combinator." - [(maybe parser)]) + ($.documentation (/.Parser state it) + "A generic parser.") -(documentation: /.result - (format "Executes the parser on the input." - \n "Does not verify that all of the input has been consumed by the parser." - \n "Returns both the parser's output, and a value that represents the remaining input.") - [(result parser input)]) + ($.documentation /.assertion + "Fails with the given message if the test is #0." + [(assertion message test)]) -(documentation: /.and - "Sequencing combinator." - [(and first second)]) + ($.documentation /.maybe + "Optionality combinator." + [(maybe parser)]) -(documentation: /.or - "Heterogeneous alternative combinator." - [(or left right)]) + ($.documentation /.result + (format "Executes the parser on the input." + \n "Does not verify that all of the input has been consumed by the parser." + \n "Returns both the parser's output, and a value that represents the remaining input.") + [(result parser input)]) -(documentation: /.either - "Homogeneous alternative combinator." - [(either this that)]) + ($.documentation /.and + "Sequencing combinator." + [(and first second)]) -(documentation: /.some - "0-or-more combinator." - [(some parser)]) + ($.documentation /.or + "Heterogeneous alternative combinator." + [(or left right)]) -(documentation: /.many - "1-or-more combinator." - [(many parser)]) + ($.documentation /.either + "Homogeneous alternative combinator." + [(either this that)]) -(documentation: /.exactly - "Parse exactly N times." - [(exactly amount parser)]) + ($.documentation /.some + "0-or-more combinator." + [(some parser)]) -(documentation: /.at_least - "Parse at least N times." - [(at_least amount parser)]) + ($.documentation /.many + "1-or-more combinator." + [(many parser)]) -(documentation: /.at_most - "Parse at most N times." - [(at_most amount parser)]) + ($.documentation /.exactly + "Parse exactly N times." + [(exactly amount parser)]) -(documentation: /.between - "" - [(between minimum additional parser)]) + ($.documentation /.at_least + "Parse at least N times." + [(at_least amount parser)]) -(documentation: /.separated_by - "Parses instances of 'parser' that are separated by instances of 'separator'." - [(separated_by separator parser)]) + ($.documentation /.at_most + "Parse at most N times." + [(at_most amount parser)]) -(documentation: /.not - "Only succeeds when the underlying parser fails." - [(not parser)]) + ($.documentation /.between + "" + [(between minimum additional parser)]) -(documentation: /.failure - "Always fail with this 'message'." - [(failure message)]) + ($.documentation /.separated_by + "Parses instances of 'parser' that are separated by instances of 'separator'." + [(separated_by separator parser)]) -(documentation: /.lifted - "Lift a potentially failed computation into a parser." - [(lifted operation)]) + ($.documentation /.not + "Only succeeds when the underlying parser fails." + [(not parser)]) -(documentation: /.else - "If the given parser fails, returns the default value." - [(else value parser)]) + ($.documentation /.failure + "Always fail with this 'message'." + [(failure message)]) -(documentation: /.remaining - "Yield the remaining input (without consuming it).") + ($.documentation /.lifted + "Lift a potentially failed computation into a parser." + [(lifted operation)]) -(documentation: /.rec - "Combinator for recursive parsers." - [(rec parser)]) + ($.documentation /.else + "If the given parser fails, returns the default value." + [(else value parser)]) -(documentation: /.after - "Run the parser after another one (whose output is ignored)." - [(after param subject)]) + ($.documentation /.remaining + "Yield the remaining input (without consuming it).") -(documentation: /.before - "Run the parser before another one (whose output is ignored)." - [(before param subject)]) + ($.documentation /.rec + "Combinator for recursive parsers." + [(rec parser)]) -(documentation: /.only - "Only succeed when the parser's output passes a test." - [(only test parser)]) + ($.documentation /.after + "Run the parser after another one (whose output is ignored)." + [(after param subject)]) -(documentation: /.parses? - "Ignore a parser's output and just verify that it succeeds." - [(parses? parser)]) + ($.documentation /.before + "Run the parser before another one (whose output is ignored)." + [(before param subject)]) -(documentation: /.parses - "Ignore a parser's output and just execute it." - [(parses parser)]) + ($.documentation /.only + "Only succeed when the parser's output passes a test." + [(only test parser)]) -(documentation: /.speculative - (format "Executes a parser, without actually consuming the input." - \n "That way, the same input can be consumed again by another parser.") - [(speculative parser)]) + ($.documentation /.parses? + "Ignore a parser's output and just verify that it succeeds." + [(parses? parser)]) -(documentation: /.codec - "Decode the output of a parser using a codec." - [(codec codec parser)]) + ($.documentation /.parses + "Ignore a parser's output and just execute it." + [(parses parser)]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [..Parser - ..assertion - ..maybe - ..result - ..and - ..or - ..either - ..some - ..many - ..exactly - ..at_least - ..at_most - ..between - ..separated_by - ..not - ..failure - ..lifted - ..else - ..remaining - ..rec - ..after - ..before - ..only - ..parses? - ..parses - ..speculative - ..codec - ($.default /.functor) - ($.default /.apply) - ($.default /.monad)] + ($.documentation /.speculative + (format "Executes a parser, without actually consuming the input." + \n "That way, the same input can be consumed again by another parser.") + [(speculative parser)]) + + ($.documentation /.codec + "Decode the output of a parser using a codec." + [(codec codec parser)])] [/analysis.documentation /binary.documentation /cli.documentation |