From a5a15c191c43a660bb0c8e78e93d097e27966177 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 28 Aug 2020 00:06:26 -0400 Subject: Build programs. --- stdlib/source/program/aedifex/parser.lux | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'stdlib/source/program/aedifex/parser.lux') diff --git a/stdlib/source/program/aedifex/parser.lux b/stdlib/source/program/aedifex/parser.lux index 78f6dbb60..508550a2a 100644 --- a/stdlib/source/program/aedifex/parser.lux +++ b/stdlib/source/program/aedifex/parser.lux @@ -89,7 +89,11 @@ #/.developers (list) #/.contributors (list)}) -(def: (bundle tag parser) +(def: (singular tag parser) + (All [a] (-> Code (Parser a) (Parser a))) + (.form (<>.after (.this! tag) parser))) + +(def: (plural tag parser) (All [a] (-> Code (Parser a) (Parser (List a)))) (.form (<>.after (.this! tag) (<>.some parser)))) @@ -100,10 +104,10 @@ (<>.maybe ..url) (<>.maybe ..scm) (<>.maybe .text) - (<>.default (list) (..bundle (' #licenses) ..license)) + (<>.default (list) (..plural (' #licenses) ..license)) (<>.maybe ..organization) - (<>.default (list) (..bundle (' #developers) ..developer)) - (<>.default (list) (..bundle (' #contributors) ..contributor)) + (<>.default (list) (..plural (' #developers) ..developer)) + (<>.default (list) (..plural (' #contributors) ..contributor)) )) (def: repository @@ -133,16 +137,18 @@ (`` ($_ <>.and ..artifact (<| (<>.default ..no-info) - .form - (<>.after (.this! (' #info))) - ..info) + (..singular (' #info) ..info)) (<| (<>.default (list)) - (..bundle (' #repositories)) + (..plural (' #repositories)) ..repository) (<| (<>.default (list)) - (..bundle (' #dependencies)) + (..plural (' #dependencies)) ..dependency) (<| (<>.default (list "source")) - (..bundle (' #sources)) + (..plural (' #sources)) ..source) + (<| (<>.default "target") + (..singular (' #target) .text)) + (<>.maybe (..singular (' #program) .text)) + (<>.maybe (..singular (' #test) .text)) )))) -- cgit v1.2.3