From e00ba096c8837abe85d366e0c1293c09dbe84d81 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 18 Aug 2021 03:29:15 -0400 Subject: Some bug fixes. --- .../documentation/lux/control/parser/analysis.lux | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 stdlib/source/documentation/lux/control/parser/analysis.lux (limited to 'stdlib/source/documentation/lux/control/parser/analysis.lux') 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 [ ] + [(`` (as_is (`` (documentation: + (format "Queries for a " (~~ (template.text [])) " value."))) + (`` (documentation: + (format "Assert a specific " (~~ (template.text [])) " 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)] + [])) -- cgit v1.2.3