diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/program/aedifex/parser.lux | 79 |
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 |