aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/format.lux
diff options
context:
space:
mode:
authorEduardo Julian2022-02-06 03:15:39 -0400
committerEduardo Julian2022-02-06 03:15:39 -0400
commit290de8ebcb7edc92877f2ccc333171214e5eae23 (patch)
tree7307b79865b242a057d35a3b654d8906a8b8c97e /stdlib/source/program/aedifex/format.lux
parent54bb56a07e6d8f1e76bd447436fb721a74f09f66 (diff)
Finishing the meta-compiler [Part 1]
Diffstat (limited to 'stdlib/source/program/aedifex/format.lux')
-rw-r--r--stdlib/source/program/aedifex/format.lux51
1 files changed, 32 insertions, 19 deletions
diff --git a/stdlib/source/program/aedifex/format.lux b/stdlib/source/program/aedifex/format.lux
index 8f3e63706..54e1ed57f 100644
--- a/stdlib/source/program/aedifex/format.lux
+++ b/stdlib/source/program/aedifex/format.lux
@@ -1,22 +1,26 @@
(.using
- [library
- [lux "*"
- [data
- ["[0]" text ("[1]#[0]" equivalence)]
- [collection
- ["[0]" dictionary {"+" Dictionary}]
- ["[0]" list ("[1]#[0]" monad)]
- ["[0]" set {"+" Set}]]]
- [macro
- ["[0]" code]
- ["[0]" template]]]]
- ["[0]" // "_"
- ["/" profile]
- ["[1][0]" runtime {"+" Runtime}]
- ["[1][0]" project {"+" Project}]
- ["[1][0]" dependency {"+" Dependency}]
- ["[1][0]" artifact {"+" Artifact}
- ["[1]/[0]" type]]])
+ [library
+ [lux "*"
+ [data
+ ["[0]" text ("[1]#[0]" equivalence)]
+ [collection
+ ["[0]" dictionary {"+" Dictionary}]
+ ["[0]" list ("[1]#[0]" monad)]
+ ["[0]" set {"+" Set}]]]
+ [macro
+ ["[0]" code]
+ ["[0]" template]]
+ [tool
+ [compiler
+ [meta
+ [cli {"+" Compiler}]]]]]]
+ ["[0]" // "_"
+ ["/" profile]
+ ["[1][0]" runtime {"+" Runtime}]
+ ["[1][0]" project {"+" Project}]
+ ["[1][0]" dependency {"+" Dependency}]
+ ["[1][0]" artifact {"+" Artifact}
+ ["[1]/[0]" type]]])
(type: .public (Format a)
(-> a Code))
@@ -141,6 +145,14 @@
(` [(~ (code.text program))
(~+ (list#each code.text parameters))]))
+(def: (compiler [definition parameters])
+ (Format Compiler)
+ (` [(~ (code.symbol definition))
+ (~+ (list#each code.text parameters))]))
+
+(def: .public lux_compiler_label
+ "lux")
+
(def: (profile value)
(Format /.Profile)
(`` (|> ..empty
@@ -149,7 +161,8 @@
(..on_maybe "info" (value@ /.#info value) ..info)
(..on_set "repositories" (value@ /.#repositories value) code.text)
(..on_set "dependencies" (value@ /.#dependencies value) ..dependency)
- (dictionary.has "compiler" (..dependency (value@ /.#compiler value)))
+ (dictionary.has ..lux_compiler_label (..dependency (value@ /.#lux value)))
+ (..on_list "compilers" (value@ /.#compilers value) ..compiler)
(..on_set "sources" (value@ /.#sources value) code.text)
(dictionary.has "target" (code.text (value@ /.#target value)))
(..on_maybe "program" (value@ /.#program value) code.text)