diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/control/parser/synthesis.lux | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/stdlib/source/library/lux/control/parser/synthesis.lux b/stdlib/source/library/lux/control/parser/synthesis.lux index 1ecdaab9e..cde50518e 100644 --- a/stdlib/source/library/lux/control/parser/synthesis.lux +++ b/stdlib/source/library/lux/control/parser/synthesis.lux @@ -1,6 +1,6 @@ (.module: [library - [lux (#- Variant Tuple function loop i64) + [lux (#- Variant Tuple function loop i64 local) [abstract [monad (#+ do)]] [control @@ -29,30 +29,30 @@ ["/" synthesis (#+ Synthesis Abstraction)]]]]]]] ["." //]) -(exception: #export (cannot_parse {input (List Synthesis)}) +(exception: .public (cannot_parse {input (List Synthesis)}) (exception.report ["Input" (exception.listing /.%synthesis input)])) -(exception: #export (unconsumed_input {input (List Synthesis)}) +(exception: .public (unconsumed_input {input (List Synthesis)}) (exception.report ["Input" (exception.listing /.%synthesis input)])) -(exception: #export (expected_empty_input {input (List Synthesis)}) +(exception: .public (expected_empty_input {input (List Synthesis)}) (exception.report ["Input" (exception.listing /.%synthesis input)])) -(exception: #export (wrong_arity {expected Arity} {actual Arity}) +(exception: .public (wrong_arity {expected Arity} {actual Arity}) (exception.report ["Expected" (%.nat expected)] ["Actual" (%.nat actual)])) -(exception: #export empty_input) +(exception: .public empty_input) -(type: #export Parser +(type: .public Parser {#.doc (doc "A parser for the Lux compiler's synthesis nodes using during optimization.")} (//.Parser (List Synthesis))) -(def: #export (run parser input) +(def: .public (run parser input) {#.doc (doc "Executes the parser against the inputs." "Ensures all inputs are consumed by the parser.")} (All [a] (-> (Parser a) (List Synthesis) (Try a))) @@ -66,7 +66,7 @@ (#try.Success [unconsumed _]) (exception.except ..unconsumed_input unconsumed))) -(def: #export any +(def: .public any {#.doc (doc "Yields a synthesis node without subjecting it to any analysis.")} (Parser Synthesis) (.function (_ input) @@ -77,7 +77,7 @@ (#.Item [head tail]) (#try.Success [tail head])))) -(def: #export end! +(def: .public end! {#.doc "Ensures there are no more inputs."} (Parser Any) (.function (_ tokens) @@ -85,7 +85,7 @@ #.End (#try.Success [tokens []]) _ (exception.except ..expected_empty_input [tokens])))) -(def: #export end? +(def: .public end? {#.doc "Checks whether there are no more inputs."} (Parser Bit) (.function (_ tokens) @@ -94,7 +94,7 @@ _ false)]))) (template [<query> <assertion> <tag> <type> <eq>] - [(`` (def: #export <query> + [(`` (def: .public <query> {#.doc (doc (~~ (template.text ["Queries for a " <query> " synthesis node."])))} (Parser <type>) (.function (_ input) @@ -105,7 +105,7 @@ _ (exception.except ..cannot_parse input))))) - (`` (def: #export (<assertion> expected) + (`` (def: .public (<assertion> expected) {#.doc (doc (~~ (template.text ["Checks for a specific " <query> " synthesis node."])))} (-> <type> (Parser Any)) (.function (_ input) @@ -127,7 +127,7 @@ [constant constant! /.constant Name name.equivalence] ) -(def: #export (tuple parser) +(def: .public (tuple parser) {#.doc (doc "Parses the contents of a tuple.")} (All [a] (-> (Parser a) (Parser a))) (.function (_ input) @@ -140,7 +140,7 @@ _ (exception.except ..cannot_parse input)))) -(def: #export (function expected parser) +(def: .public (function expected parser) {#.doc (doc "Parses the body of a function with the 'expected' arity.")} (All [a] (-> Arity (Parser a) (Parser [(Environment Synthesis) a]))) (.function (_ input) @@ -155,7 +155,7 @@ _ (exception.except ..cannot_parse input)))) -(def: #export (loop init_parsers iteration_parser) +(def: .public (loop init_parsers iteration_parser) {#.doc (doc "Parses the initial values and the body of a loop.")} (All [a b] (-> (Parser a) (Parser b) (Parser [Register a b]))) (.function (_ input) |