aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/program.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/documentation/lux/program.lux')
-rw-r--r--stdlib/source/documentation/lux/program.lux103
1 files changed, 54 insertions, 49 deletions
diff --git a/stdlib/source/documentation/lux/program.lux b/stdlib/source/documentation/lux/program.lux
index bc126a34a..d0ea5d8ac 100644
--- a/stdlib/source/documentation/lux/program.lux
+++ b/stdlib/source/documentation/lux/program.lux
@@ -6,65 +6,70 @@
["[0]" io]]
[data
["[0]" text (.only \n)
- ["%" \\format (.only format)]]]]]
+ ["%" \\format (.only format)]]
+ [collection
+ ["[0]" list]]]]]
["[0]" \\parser]
[\\library
["[0]" /]])
-(.def \\parser
- (.List $.Module)
- ($.module \\parser._
- ""
- [($.definition (\\parser.Parser it)
- "A command-line interface parser.")
+(def \\parser
+ (List $.Documentation)
+ (list ($.module \\parser._
+ "")
+ ($.definition (\\parser.Parser it)
+ "A command-line interface parser.")
- ($.definition \\parser.result
- "Executes the parser and verifies that all inputs are processed."
- [(result parser inputs)])
+ ($.definition \\parser.result
+ "Executes the parser and verifies that all inputs are processed."
+ [(result parser inputs)])
- ($.definition \\parser.any
- "Just returns the next input without applying any logic.")
+ ($.definition \\parser.any
+ "Just returns the next input without applying any logic.")
- ($.definition \\parser.parse
- "Parses the next input with a parsing function."
- [(parse parser)])
+ ($.definition \\parser.parse
+ "Parses the next input with a parsing function."
+ [(parse parser)])
- ($.definition \\parser.this
- "Checks that a token is in the inputs."
- [(this reference)])
+ ($.definition \\parser.this
+ "Checks that a token is in the inputs."
+ [(this reference)])
- ($.definition \\parser.somewhere
- "Given a parser, tries to parse it somewhere in the inputs (i.e. not necessarily parsing the immediate inputs)."
- [(somewhere cli)])
+ ($.definition \\parser.somewhere
+ "Given a parser, tries to parse it somewhere in the inputs (i.e. not necessarily parsing the immediate inputs)."
+ [(somewhere cli)])
- ($.definition \\parser.end
- "Ensures there are no more inputs.")
+ ($.definition \\parser.end
+ "Ensures there are no more inputs.")
- ($.definition \\parser.named
- "Parses a named parameter and yields its value."
- [(named name value)])
+ ($.definition \\parser.named
+ "Parses a named parameter and yields its value."
+ [(named name value)])
- ($.definition \\parser.parameter
- "Parses a parameter that can have either a short or a long name."
- [(parameter [short long] value)])]
- []))
+ ($.definition \\parser.parameter
+ "Parses a parameter that can have either a short or a long name."
+ [(parameter [short long] value)])
+ ))
-(.def .public documentation
- (.List $.Module)
- ($.module /._
- ""
- [($.definition /.program
- "Defines the entry-point to a program (similar to the 'main' function/method in other programming languages)."
- ["Can take a list of all the input parameters to the program."
- (def _
- (program all_arguments
- (do io.monad
- [foo (initialize program)]
- (do_something_with all_arguments))))]
- ["Can also parse them using CLI parsers from the library/lux/control/parser/cli module."
- (def _
- (program [config configuration_parser]
- (do io.monad
- [data (initialize program with config)]
- (do_something_with data))))])]
- [..\\parser]))
+(def .public documentation
+ (List $.Documentation)
+ (list.partial ($.module /._
+ "")
+
+ ($.definition /.program
+ "Defines the entry-point to a program (similar to the 'main' function/method in other programming languages)."
+ ["Can take a list of all the input parameters to the program."
+ (def _
+ (program all_arguments
+ (do io.monad
+ [foo (initialize program)]
+ (do_something_with all_arguments))))]
+ ["Can also parse them using CLI parsers from the library/lux/control/parser/cli module."
+ (def _
+ (program [config configuration_parser]
+ (do io.monad
+ [data (initialize program with config)]
+ (do_something_with data))))])
+
+ ..\\parser
+ ))