aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/parser.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/parser.lux
parent54bb56a07e6d8f1e76bd447436fb721a74f09f66 (diff)
Finishing the meta-compiler [Part 1]
Diffstat (limited to 'stdlib/source/program/aedifex/parser.lux')
-rw-r--r--stdlib/source/program/aedifex/parser.lux79
1 files changed, 47 insertions, 32 deletions
diff --git a/stdlib/source/program/aedifex/parser.lux b/stdlib/source/program/aedifex/parser.lux
index 44c16133f..52a9a292c 100644
--- a/stdlib/source/program/aedifex/parser.lux
+++ b/stdlib/source/program/aedifex/parser.lux
@@ -1,32 +1,35 @@
(.using
- [library
- [lux {"-" Module type}
- [abstract
- [monad {"+" do}]]
- [control
- ["<>" parser
- ["<[0]>" code {"+" Parser}]]]
- [data
- ["[0]" text]
- [collection
- ["[0]" dictionary {"+" Dictionary}]
- ["[0]" set {"+" Set}]]]
- [tool
- [compiler
- [meta
- [archive
- [descriptor {"+" Module}]]]]]
- [world
- [net {"+" URL}]]]]
- ["[0]" // "_"
- ["/" profile]
- ["[1][0]" runtime {"+" Runtime}]
- ["[1][0]" project {"+" Project}]
- ["[1][0]" dependency]
- ["[1][0]" repository "_"
- ["[1]" remote]]
- ["[1][0]" artifact {"+" Artifact}
- ["[1]/[0]" type]]])
+ [library
+ [lux {"-" Module type}
+ [abstract
+ [monad {"+" do}]]
+ [control
+ ["<>" parser
+ ["<[0]>" code {"+" Parser}]]]
+ [data
+ ["[0]" text]
+ [collection
+ ["[0]" dictionary {"+" Dictionary}]
+ ["[0]" set {"+" Set}]]]
+ [tool
+ [compiler
+ [meta
+ [cli {"+" Compiler}]
+ [archive
+ [module
+ [descriptor {"+" Module}]]]]]]
+ [world
+ [net {"+" URL}]]]]
+ ["[0]" // "_"
+ ["/" profile]
+ ["[1][0]" runtime {"+" Runtime}]
+ ["[1][0]" project {"+" Project}]
+ ["[1][0]" dependency]
+ ["[1][0]" format]
+ ["[1][0]" repository "_"
+ ["[1]" remote]]
+ ["[1][0]" artifact {"+" Artifact}
+ ["[1]/[0]" type]]])
(def: (as_input input)
(-> (Maybe Code) (List Code))
@@ -155,6 +158,14 @@
(<>.else //artifact/type.lux_library ..type)
)))
+(def: compiler
+ (Parser Compiler)
+ (<code>.tuple
+ ($_ <>.and
+ <code>.global_symbol
+ (<>.some <code>.text)
+ )))
+
(def: source
(Parser /.Source)
<code>.text)
@@ -203,9 +214,12 @@
(|> (..plural input "dependencies" ..dependency)
(# ! each (set.of_list //dependency.hash))
(<>.else (set.empty //dependency.hash))))
- ^compiler (|> ..dependency
- (..singular input "compiler")
- (<>.else /.default_compiler))
+ ^lux (|> ..dependency
+ (..singular input //format.lux_compiler_label)
+ (<>.else /.default_compiler))
+ ^compilers (|> ..compiler
+ (..plural input "compilers")
+ (<>.else (list)))
^sources (: (Parser (Set /.Source))
(|> (..plural input "sources" ..source)
(# ! each (set.of_list text.hash))
@@ -245,7 +259,8 @@
^info
^repositories
^dependencies
- ^compiler
+ ^lux
+ ^compilers
^sources
^target
^program