From 220c804f9136c73058802575ee49f3f769d5599f Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 17 Mar 2022 04:29:59 -0400 Subject: De-sigil-ification: ! --- stdlib/source/program/aedifex/parser.lux | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'stdlib/source/program') diff --git a/stdlib/source/program/aedifex/parser.lux b/stdlib/source/program/aedifex/parser.lux index 7b1447b8c..da92a59d9 100644 --- a/stdlib/source/program/aedifex/parser.lux +++ b/stdlib/source/program/aedifex/parser.lux @@ -4,6 +4,7 @@ [abstract [monad {"+" do}]] [control + ["[0]" maybe] ["<>" parser ["<[0]>" code {"+" Parser}]]] [data @@ -33,24 +34,15 @@ ["[1][0]" artifact {"+" Artifact} ["[1]/[0]" type]]]) -(def: (as_input input) - (-> (Maybe Code) (List Code)) - (case input - {.#Some input} - (list input) - - {.#None} - (list))) - (def: (singular input tag parser) (All (_ a) (-> (Dictionary Text Code) Text (Parser a) (Parser a))) - (.local (..as_input (dictionary.value tag input)) - parser)) + (.locally (maybe.list (dictionary.value tag input)) + parser)) (def: (plural input tag parser) (All (_ a) (-> (Dictionary Text Code) Text (Parser a) (Parser (List a)))) - (.local (..as_input (dictionary.value tag input)) - (.tuple (<>.some parser)))) + (.locally (maybe.list (dictionary.value tag input)) + (.tuple (<>.some parser)))) (def: group (Parser //artifact.Group) @@ -96,8 +88,8 @@ (..singular input "url" ..url) (<>.else {/.#Repo} (..singular input "type" - (<>.or (.this! (' "repo")) - (.this! (' "manual")))))))) + (<>.or (.this (' "repo")) + (.this (' "manual")))))))) (def: organization (Parser /.Organization) @@ -164,7 +156,7 @@ (Parser Compiler) (.tuple ($_ <>.and - .global_symbol + .global (<>.some .text) ))) -- cgit v1.2.3