From b216900093c905b3b20dd45c69e577b192e2f7a3 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 25 Aug 2021 16:47:50 -0400 Subject: Updates to the Lua compiler. --- stdlib/source/program/aedifex/cli.lux | 46 ++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 20 deletions(-) (limited to 'stdlib/source/program/aedifex/cli.lux') diff --git a/stdlib/source/program/aedifex/cli.lux b/stdlib/source/program/aedifex/cli.lux index 87ad9938a..b51a0d1f1 100644 --- a/stdlib/source/program/aedifex/cli.lux +++ b/stdlib/source/program/aedifex/cli.lux @@ -2,7 +2,8 @@ [library [lux (#- Name) [abstract - [equivalence (#+ Equivalence)]] + [equivalence (#+ Equivalence)] + [monad (#+ do)]] [control ["<>" parser ["." cli (#+ Parser)]]] @@ -16,8 +17,9 @@ ["/" profile (#+ Name)]]) (type: .public Compilation - #Build - #Test) + (Variant + #Build + #Test)) (implementation: any_equivalence (Equivalence Any) @@ -36,14 +38,15 @@ (cli.this "test"))) (type: .public Command - #Version - #Clean - #POM - #Dependencies - #Install - (#Deploy Text Identity) - (#Compilation Compilation) - (#Auto Compilation)) + (Variant + #Version + #Clean + #POM + #Dependencies + #Install + (#Deploy Text Identity) + (#Compilation Compilation) + (#Auto Compilation))) (def: .public equivalence (Equivalence Command) @@ -86,12 +89,15 @@ )) (def: .public command - (Parser [Name Command]) - ($_ <>.either - (<>.after (cli.this "with") - ($_ <>.and - cli.any - ..command')) - (\ <>.monad each (|>> [/.default]) - ..command') - )) + (Parser [(List Name) Command]) + (<>.rec + (function (_ command) + ($_ <>.either + (<>.after (cli.this "with") + (do <>.monad + [head cli.any + [tail command] command] + (in [(#.Item head tail) command]))) + (\ <>.monad each (|>> [(list /.default)]) + ..command') + )))) -- cgit v1.2.3