From d98d1cb26f8cd3aa49f9c1e9f461ae0ee176df7c Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 13 Mar 2019 19:55:56 -0400 Subject: The general shape of the compiler has been recognized as a program unto itself (albeit a program which must be parameterized). --- stdlib/source/program/compositor/cli.lux | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 stdlib/source/program/compositor/cli.lux (limited to 'stdlib/source/program/compositor/cli.lux') diff --git a/stdlib/source/program/compositor/cli.lux b/stdlib/source/program/compositor/cli.lux new file mode 100644 index 000000000..e08c83c7e --- /dev/null +++ b/stdlib/source/program/compositor/cli.lux @@ -0,0 +1,43 @@ +(.module: + [lux #* + [control + ["p" parser]] + ["." cli (#+ CLI)] + [world + [file (#+ Path)]]] + ## [/// + ## [importer (#+ Source)]] + ) + +(type: #export Configuration + {## #sources (List Source) + #sources (List Path) + #target Path + #module Text}) + +(type: #export Service + (#Compilation Configuration) + (#Interpretation Configuration)) + +(do-template [ ] + [(def: #export + (CLI Text) + (cli.named cli.any))] + + [source "--source"] + [target "--target"] + [module "--module"] + ) + +(def: #export configuration + (CLI Configuration) + ($_ p.and + (p.some ..source) + ..target + ..module)) + +(def: #export service + (CLI Service) + ($_ p.or + (p.after (cli.this "build") ..configuration) + (p.after (cli.this "repl") ..configuration))) -- cgit v1.2.3