aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/cli.lux (renamed from stdlib/source/program/compositor/cli.lux)27
-rw-r--r--stdlib/source/program/compositor.lux8
-rw-r--r--stdlib/source/program/compositor/export.lux55
-rw-r--r--stdlib/source/program/compositor/import.lux8
4 files changed, 52 insertions, 46 deletions
diff --git a/stdlib/source/program/compositor/cli.lux b/stdlib/source/library/lux/tool/compiler/meta/cli.lux
index 1962569b3..c4d5eb819 100644
--- a/stdlib/source/program/compositor/cli.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/cli.lux
@@ -4,13 +4,13 @@
[control
[pipe {"+" case>}]
["<>" parser
- ["[0]" cli {"+" Parser}]]]
+ ["<[0]>" cli {"+" Parser}]]]
[tool
[compiler
[meta
[archive
[module
- [descriptor {"+" Module}]]]]]]
+ ["[0]" descriptor]]]]]]
[world
[file {"+" Path}]]]])
@@ -26,8 +26,19 @@
(type: .public Target
Path)
+(type: .public Module
+ descriptor.Module)
+
(type: .public Compilation
- [(List Source) (List Host_Dependency) (List Library) Target Module])
+ (Record
+ [#sources (List Source)
+ #host_dependencies (List Host_Dependency)
+ #libraries (List Library)
+ #target Target
+ #module Module]))
+
+(type: .public Interpretation
+ ..Compilation)
(type: .public Export
[(List Source) Target])
@@ -35,13 +46,13 @@
(type: .public Service
(Variant
{#Compilation Compilation}
- {#Interpretation Compilation}
+ {#Interpretation Interpretation}
{#Export Export}))
(template [<name> <long> <type>]
[(def: <name>
(Parser <type>)
- (cli.named <long> cli.any))]
+ (<cli>.named <long> <cli>.any))]
[source_parser "--source" Source]
[host_dependency_parser "--host_dependency" Host_Dependency]
@@ -53,21 +64,21 @@
(def: .public service
(Parser Service)
($_ <>.or
- (<>.after (cli.this "build")
+ (<>.after (<cli>.this "build")
($_ <>.and
(<>.some ..source_parser)
(<>.some ..host_dependency_parser)
(<>.some ..library_parser)
..target_parser
..module_parser))
- (<>.after (cli.this "repl")
+ (<>.after (<cli>.this "repl")
($_ <>.and
(<>.some ..source_parser)
(<>.some ..host_dependency_parser)
(<>.some ..library_parser)
..target_parser
..module_parser))
- (<>.after (cli.this "export")
+ (<>.after (<cli>.this "export")
($_ <>.and
(<>.some ..source_parser)
..target_parser))
diff --git a/stdlib/source/program/compositor.lux b/stdlib/source/program/compositor.lux
index 59c53550e..0d90a15dc 100644
--- a/stdlib/source/program/compositor.lux
+++ b/stdlib/source/program/compositor.lux
@@ -40,6 +40,7 @@
[phase
[extension {"+" Extender}]]]]
[meta
+ ["[0]" cli {"+" Service}]
[packager {"+" Packager}]
[archive {"+" Archive}
["[0]" unit]
@@ -50,7 +51,6 @@
... ["[0]" interpreter]
]]]
["[0]" / "_"
- ["[1][0]" cli {"+" Service}]
["[1][0]" static {"+" Static}]
["[1][0]" export]
["[1][0]" import]])
@@ -148,7 +148,7 @@
(do [! async.monad]
[platform (async.future platform)]
(case service
- {/cli.#Compilation compilation}
+ {cli.#Compilation compilation}
(<| (or_crash! "Compilation failed:")
..timed
(do (try.with async.monad)
@@ -182,14 +182,14 @@
program_context)]
(in (debug.log! "Compilation complete!"))))
- {/cli.#Export export}
+ {cli.#Export export}
(<| (or_crash! "Export failed:")
(do (try.with async.monad)
[_ (/export.export (value@ platform.#&file_system platform)
export)]
(in (debug.log! "Export complete!"))))
- {/cli.#Interpretation interpretation}
+ {cli.#Interpretation interpretation}
... TODO: Fix the interpreter...
(undefined)
... (<| (or_crash! "Interpretation failed:")
diff --git a/stdlib/source/program/compositor/export.lux b/stdlib/source/program/compositor/export.lux
index cb19398e7..4ac08f423 100644
--- a/stdlib/source/program/compositor/export.lux
+++ b/stdlib/source/program/compositor/export.lux
@@ -1,32 +1,31 @@
(.using
- [library
- [lux {"-" Source}
- [abstract
- ["[0]" monad {"+" do}]]
- [control
- ["[0]" try {"+" Try}]
- [concurrency
- ["[0]" async {"+" Async}]]]
- [data
- ["[0]" text
- ["%" format {"+" format}]]
- [collection
- ["[0]" dictionary]
- ["[0]" sequence]]
- [format
- ["[0]" binary]
- ["[0]" tar]]]
- [time
- ["[0]" instant]]
- [tool
- [compiler
- [meta
- ["[0]" io "_"
- ["[1]" context {"+" Extension}]]]]]
- [world
- ["[0]" file]]]]
- [//
- [cli {"+" Source Export}]])
+ [library
+ [lux {"-" Source}
+ [abstract
+ ["[0]" monad {"+" do}]]
+ [control
+ ["[0]" try {"+" Try}]
+ [concurrency
+ ["[0]" async {"+" Async}]]]
+ [data
+ ["[0]" text
+ ["%" format {"+" format}]]
+ [collection
+ ["[0]" dictionary]
+ ["[0]" sequence]]
+ [format
+ ["[0]" binary]
+ ["[0]" tar]]]
+ [time
+ ["[0]" instant]]
+ [tool
+ [compiler
+ [meta
+ [cli {"+" Source Export}]
+ ["[0]" io "_"
+ ["[1]" context {"+" Extension}]]]]]
+ [world
+ ["[0]" file]]]])
(def: file
"library.tar")
diff --git a/stdlib/source/program/compositor/import.lux b/stdlib/source/program/compositor/import.lux
index 9554ec934..7f21f20ec 100644
--- a/stdlib/source/program/compositor/import.lux
+++ b/stdlib/source/program/compositor/import.lux
@@ -22,13 +22,9 @@
[tool
[compiler
[meta
- [archive
- [module
- [descriptor {"+" Module}]]]]]]
+ [cli {"+" Library Module}]]]]
[world
- ["[0]" file]]]]
- [//
- [cli {"+" Library}]])
+ ["[0]" file]]]])
(def: Action
(type (All (_ a) (Async (Try a)))))