diff options
author | Eduardo Julian | 2019-03-13 19:55:56 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-03-13 19:55:56 -0400 |
commit | d98d1cb26f8cd3aa49f9c1e9f461ae0ee176df7c (patch) | |
tree | b3500454334fce41b034ab37a2e0594b62354eb2 /stdlib/source/program/compositor | |
parent | f49a6d1b8ae5db27270f99ecf92c40c74a4334e3 (diff) |
The general shape of the compiler has been recognized as a program unto itself (albeit a program which must be parameterized).
Diffstat (limited to 'stdlib/source/program/compositor')
-rw-r--r-- | stdlib/source/program/compositor/cli.lux | 43 |
1 files changed, 43 insertions, 0 deletions
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 [<name> <long>] + [(def: #export <name> + (CLI Text) + (cli.named <long> 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))) |