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.lux38
1 files changed, 20 insertions, 18 deletions
diff --git a/stdlib/source/documentation/lux/program.lux b/stdlib/source/documentation/lux/program.lux
index d0ea5d8ac..365f2f478 100644
--- a/stdlib/source/documentation/lux/program.lux
+++ b/stdlib/source/documentation/lux/program.lux
@@ -22,33 +22,33 @@
($.definition \\parser.result
"Executes the parser and verifies that all inputs are processed."
- [(result parser inputs)])
+ ($.example (result parser inputs)))
($.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)])
+ ($.example (parse parser)))
($.definition \\parser.this
"Checks that a token is in the inputs."
- [(this reference)])
+ ($.example (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)])
+ ($.example (somewhere cli)))
($.definition \\parser.end
"Ensures there are no more inputs.")
($.definition \\parser.named
"Parses a named parameter and yields its value."
- [(named name value)])
+ ($.example (named name value)))
($.definition \\parser.parameter
"Parses a parameter that can have either a short or a long name."
- [(parameter [short long] value)])
+ ($.example (parameter [short long] value)))
))
(def .public documentation
@@ -58,18 +58,20 @@
($.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))))])
+
+ ($.comment "Can take a list of all the input parameters to the program.")
+ ($.example (def _
+ (program all_arguments
+ (do io.monad
+ [foo (initialize program)]
+ (do_something_with all_arguments)))))
+
+ ($.comment "Can also parse them using CLI parsers from the library/lux/control/parser/cli module.")
+ ($.example (def _
+ (program [config configuration_parser]
+ (do io.monad
+ [data (initialize program with config)]
+ (do_something_with data))))))
..\\parser
))