aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/parser.lux
diff options
context:
space:
mode:
authorEduardo Julian2020-08-28 00:06:26 -0400
committerEduardo Julian2020-08-28 00:06:26 -0400
commita5a15c191c43a660bb0c8e78e93d097e27966177 (patch)
tree5dfc517fa34e1bacfbfed426b0ead3bc74c50731 /stdlib/source/program/aedifex/parser.lux
parentc8f9f42a258f1f2f961c7f8c5571cce843e97a0a (diff)
Build programs.
Diffstat (limited to 'stdlib/source/program/aedifex/parser.lux')
-rw-r--r--stdlib/source/program/aedifex/parser.lux26
1 files changed, 16 insertions, 10 deletions
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)))
+ (<c>.form (<>.after (<c>.this! tag) parser)))
+
+(def: (plural tag parser)
(All [a] (-> Code (Parser a) (Parser (List a))))
(<c>.form (<>.after (<c>.this! tag)
(<>.some parser))))
@@ -100,10 +104,10 @@
(<>.maybe ..url)
(<>.maybe ..scm)
(<>.maybe <c>.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)
- <c>.form
- (<>.after (<c>.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) <c>.text))
+ (<>.maybe (..singular (' #program) <c>.text))
+ (<>.maybe (..singular (' #test) <c>.text))
))))