diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/ffi.jvm.lux | 12 | ||||
-rw-r--r-- | stdlib/source/library/lux/target/jvm/bytecode/instruction.lux | 86 | ||||
-rw-r--r-- | stdlib/source/library/lux/target/python.lux | 4 | ||||
-rw-r--r-- | stdlib/source/library/lux/tool/compiler/default/platform.lux | 2 | ||||
-rw-r--r-- | stdlib/source/library/lux/tool/compiler/meta/cli.lux (renamed from stdlib/source/program/compositor/cli.lux) | 27 |
5 files changed, 71 insertions, 60 deletions
diff --git a/stdlib/source/library/lux/ffi.jvm.lux b/stdlib/source/library/lux/ffi.jvm.lux index 55cbe77ba..f13818a4a 100644 --- a/stdlib/source/library/lux/ffi.jvm.lux +++ b/stdlib/source/library/lux/ffi.jvm.lux @@ -585,18 +585,18 @@ (<code>.form (<>.and class_name^ (<>.some (parameter^ type_vars))))))] (in (type.class (name.safe name) parameters)))) -(exception: .public (unexpected_type_variable [name Text - type_vars (List (Type Var))]) +(exception: .public (unknown_type_variable [name Text + type_vars (List (Type Var))]) (exception.report ["Unexpected Type Variable" (%.text name)] ["Expected Type Variables" (exception.listing parser.name type_vars)])) -(def: (variable^ type_vars) +(def: (type_variable options) (-> (List (Type Var)) (Parser (Type Parameter))) (do <>.monad [name <code>.local_symbol - _ (..assertion ..unexpected_type_variable [name type_vars] - (list.member? text.equivalence (list#each parser.name type_vars) name))] + _ (..assertion ..unknown_type_variable [name options] + (list.member? text.equivalence (list#each parser.name options) name))] (in (type.var name)))) (def: wildcard^ @@ -623,7 +623,7 @@ (function (_ _) (let [class^ (..class^' parameter^ type_vars)] ($_ <>.either - (..variable^ type_vars) + (..type_variable type_vars) ..wildcard^ (upper^ class^) (lower^ class^) diff --git a/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux b/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux index d1962e192..c422dd1c2 100644 --- a/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux +++ b/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux @@ -1,40 +1,40 @@ (.using - [library - [lux "*" - [abstract - [monad {"+" do}] - [monoid {"+" Monoid}]] - [control - ["[0]" function] - ["[0]" try]] - [data - ["[0]" product] - ["[0]" binary] - ["[0]" format "_" - ["[1]" binary {"+" Mutation Specification}]] - [collection - ["[0]" list]]] - [macro - ["[0]" template]] - [math - [number {"+" hex} - ["n" nat]]] - [type - abstract]]] - ["[0]" // "_" - ["[1][0]" address {"+" Address}] - ["[1][0]" jump {"+" Jump Big_Jump}] - [environment - [limit - [registry {"+" Register}]]] - ["/[1]" // "_" - ["[1][0]" index {"+" Index}] - ["[1][0]" constant {"+" Class Reference}] - [encoding - ["[1][0]" unsigned {"+" U1 U2 U4}] - ["[1][0]" signed {"+" S1 S2 S4}]] - [type - [category {"+" Value Method}]]]]) + [library + [lux "*" + [abstract + [monad {"+" do}] + [monoid {"+" Monoid}]] + [control + ["[0]" function] + ["[0]" try]] + [data + ["[0]" product] + ["[0]" binary] + ["[0]" format "_" + ["[1]" binary {"+" Mutation Specification}]] + [collection + ["[0]" list]]] + [macro + ["[0]" template]] + [math + [number {"+" hex} + ["n" nat]]] + [type + abstract]]] + ["[0]" // "_" + ["[1][0]" address {"+" Address}] + ["[1][0]" jump {"+" Jump Big_Jump}] + [environment + [limit + [registry {"+" Register}]]] + ["/[1]" // "_" + ["[1][0]" index {"+" Index}] + ["[1][0]" constant {"+" Class Reference}] + [encoding + ["[1][0]" unsigned {"+" U1 U2 U4}] + ["[1][0]" signed {"+" S1 S2 S4}]] + [type + [category {"+" Value Method}]]]]) (type: .public Size U2) @@ -60,15 +60,15 @@ (type: Opcode Nat) -(template [<name> <size>] +(template [<size> <name>] [(def: <name> Size (|> <size> ///unsigned.u2 try.trusted))] - [opcode_size 1] - [register_size 1] - [byte_size 1] - [index_size 2] - [big_jump_size 4] - [integer_size 4] + [1 opcode_size] + [1 register_size] + [1 byte_size] + [2 index_size] + [4 big_jump_size] + [4 integer_size] ) (def: (nullary' opcode) diff --git a/stdlib/source/library/lux/target/python.lux b/stdlib/source/library/lux/target/python.lux index 6d3746721..87864e062 100644 --- a/stdlib/source/library/lux/target/python.lux +++ b/stdlib/source/library/lux/target/python.lux @@ -194,8 +194,8 @@ ... ..expression (format left_delimiter (|> entries - (list#each entry_serializer) - (text.interposed ", ")) + (list#each (|>> entry_serializer (text.suffix ", "))) + text.together) right_delimiter)))) (template [<name> <pre> <post>] diff --git a/stdlib/source/library/lux/tool/compiler/default/platform.lux b/stdlib/source/library/lux/tool/compiler/default/platform.lux index 668daffc5..dc9ff4533 100644 --- a/stdlib/source/library/lux/tool/compiler/default/platform.lux +++ b/stdlib/source/library/lux/tool/compiler/default/platform.lux @@ -49,6 +49,7 @@ [phase ["[0]" extension {"+" Extender}]]]] [meta + [cli {"+" Compilation Library}] ["[0]" archive {"+" Output Archive} ["[0]" registry {"+" Registry}] ["[0]" artifact] @@ -60,7 +61,6 @@ ["ioW" archive]]]]] [program [compositor - [cli {"+" Compilation Library}] [import {"+" Import}] ["[0]" static {"+" Static}]]]) 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)) |