From fcb1dcee2a4d502b41852a4c8e26b53ae7b2041e Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 28 May 2020 22:13:39 -0400 Subject: Can now export Lux code as library TAR files. --- stdlib/source/program/compositor/cli.lux | 69 +++++++++++++++++++------------- 1 file changed, 41 insertions(+), 28 deletions(-) (limited to 'stdlib/source/program/compositor/cli.lux') diff --git a/stdlib/source/program/compositor/cli.lux b/stdlib/source/program/compositor/cli.lux index 0c20257ed..940665680 100644 --- a/stdlib/source/program/compositor/cli.lux +++ b/stdlib/source/program/compositor/cli.lux @@ -1,42 +1,55 @@ (.module: - [lux #* + [lux (#- Module Source) [control - ["p" parser + ["<>" parser ["." cli (#+ Parser)]]] + [tool + [compiler + [meta + [archive + [descriptor (#+ Module)]]]]] [world [file (#+ Path)]]]) -(type: #export Service - #Compilation - #Interpretation) +(type: #export Source Path) +(type: #export Target Path) + +(type: #export Compilation + [(List Source) Target Module]) + +(type: #export Export + [(List Source) Target]) -(type: #export Configuration - {#service Service - #sources (List Path) - #target Path - #module Text}) +(type: #export Service + (#Compilation Compilation) + (#Interpretation Compilation) + (#Export Export)) -(template [ ] +(template [ ] [(def: - (Parser Text) + (Parser ) (cli.named cli.any))] - [source "--source"] - [target "--target"] - [module "--module"] + [source "--source" Source] + [target "--target" Target] + [module "--module" Module] ) - -(def: service +(def: #export service (Parser Service) - ($_ p.or - (cli.this "build") - (cli.this "repl"))) - -(def: #export configuration - (Parser Configuration) - ($_ p.and - ..service - (p.some ..source) - ..target - ..module)) + ($_ <>.or + (<>.after (cli.this "build") + ($_ <>.and + (<>.some ..source) + ..target + ..module)) + (<>.after (cli.this "repl") + ($_ <>.and + (<>.some ..source) + ..target + ..module)) + (<>.after (cli.this "export") + ($_ <>.and + (<>.some ..source) + ..target)) + )) -- cgit v1.2.3