diff options
author | Eduardo Julian | 2021-08-18 03:29:15 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-08-18 03:29:15 -0400 |
commit | e00ba096c8837abe85d366e0c1293c09dbe84d81 (patch) | |
tree | dc1f0955d4461ae30bb4945cddd74c462f1aee98 /stdlib/source/documentation/lux/control/parser/analysis.lux | |
parent | 3289b9dcf9d5d1c1e5c380e3185065c8fd32535f (diff) |
Some bug fixes.
Diffstat (limited to 'stdlib/source/documentation/lux/control/parser/analysis.lux')
-rw-r--r-- | stdlib/source/documentation/lux/control/parser/analysis.lux | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/stdlib/source/documentation/lux/control/parser/analysis.lux b/stdlib/source/documentation/lux/control/parser/analysis.lux new file mode 100644 index 000000000..1f66be4bf --- /dev/null +++ b/stdlib/source/documentation/lux/control/parser/analysis.lux @@ -0,0 +1,71 @@ +(.module: + [library + [lux (#- nat int rev local) + ["$" documentation (#+ documentation:)] + [data + [text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]]) + +(documentation: /.Parser + "A parser for Lux code analysis nodes.") + +(documentation: /.result + "Executes a parser and makes sure no inputs go unconsumed." + [(result parser input)]) + +(documentation: /.any + "Matches any value, without discrimination.") + +(documentation: /.end! + "Ensures there are no more inputs.") + +(documentation: /.end? + "Checks whether there are no more inputs.") + +(template [<query> <assertion>] + [(`` (as_is (`` (documentation: <query> + (format "Queries for a " (~~ (template.text [<query>])) " value."))) + (`` (documentation: <assertion> + (format "Assert a specific " (~~ (template.text [<query>])) " value.")))))] + + [/.bit /.bit!] + [/.nat /.nat!] + [/.int /.int!] + [/.rev /.rev!] + [/.frac /.frac!] + [/.text /.text!] + [/.local /.local!] + [/.foreign /.foreign!] + [/.constant /.constant!] + ) + +(documentation: /.tuple + "Parses only within the context of a tuple's contents." + [(tuple parser)]) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..Parser + ..result + ..any + ..end! + ..end? + ..bit ..bit! + ..nat ..nat! + ..int ..int! + ..rev ..rev! + ..frac ..frac! + ..text ..text! + ..local ..local! + ..foreign ..foreign! + ..constant ..constant! + ..tuple + ($.default /.cannot_parse) + ($.default /.unconsumed_input)] + [])) |