diff options
author | Eduardo Julian | 2021-09-08 23:14:59 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-09-08 23:14:59 -0400 |
commit | 085c9a6ef151531cb01b842ed2f4366a49b78367 (patch) | |
tree | 01d5671061f1c688fe74319196f8da0e8aa95e4c /stdlib/source/library/lux/tool/compiler | |
parent | 54ab659064990ff37a9234c9792102a3b88277d6 (diff) |
De-bracing | part 2
Diffstat (limited to 'stdlib/source/library/lux/tool/compiler')
12 files changed, 34 insertions, 31 deletions
diff --git a/stdlib/source/library/lux/tool/compiler/default/platform.lux b/stdlib/source/library/lux/tool/compiler/default/platform.lux index be5d7df27..d24ad8f33 100644 --- a/stdlib/source/library/lux/tool/compiler/default/platform.lux +++ b/stdlib/source/library/lux/tool/compiler/default/platform.lux @@ -101,11 +101,11 @@ (ioW.write system static module_id artifact_id content)))] (do [! ..monad] [_ (ioW.prepare system static module_id) - _ (for {@.python (|> output + _ (for [@.python (|> output row.list (list.sub 128) (monad.each ! (monad.each ! write_artifact!)) - (: (Action (List (List Any)))))} + (: (Action (List (List Any)))))] (|> output row.list (monad.each ..monad write_artifact!) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/js.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/js.lux index f5f47f98d..66b58bf74 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/js.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/js.lux @@ -199,7 +199,7 @@ [.let [inputT (type.tuple (list.repeated arity Any))] abstractionA (analysis/type.with_type (-> inputT Any) (phase archive abstractionC)) - _ (analysis/type.infer (for {@.js ffi.Function} + _ (analysis/type.infer (for [@.js ffi.Function] Any))] (in (#analysis.Extension extension (list (analysis.nat arity) abstractionA)))))])) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lua.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lua.lux index dd7d43516..f7ed4ed54 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lua.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lua.lux @@ -29,15 +29,15 @@ ["[0]" phase]]]]]]) (def: Nil - (for {@.lua ffi.Nil} + (for [@.lua ffi.Nil] Any)) (def: Object - (for {@.lua (type (ffi.Object Any))} + (for [@.lua (type (ffi.Object Any))] Any)) (def: Function - (for {@.lua ffi.Function} + (for [@.lua ffi.Function] Any)) (def: array::new diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/php.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/php.lux index 227bc4539..a52f8bb53 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/php.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/php.lux @@ -108,15 +108,15 @@ ))) (def: Null - (for {@.php ffi.Null} + (for [@.php ffi.Null] Any)) (def: Object - (for {@.php (type (ffi.Object Any))} + (for [@.php (type (ffi.Object Any))] Any)) (def: Function - (for {@.php ffi.Function} + (for [@.php ffi.Function] Any)) (def: object::new diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/python.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/python.lux index 2f07f677b..700f80163 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/python.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/python.lux @@ -108,20 +108,23 @@ ))) (def: None - (for {@.python - ffi.None} + (for [@.python + ffi.None] Any)) (def: Object - (for {@.python (type (ffi.Object Any))} + (for [@.python + (type (ffi.Object Any))] Any)) (def: Function - (for {@.python ffi.Function} + (for [@.python + ffi.Function] Any)) (def: Dict - (for {@.python ffi.Dict} + (for [@.python + ffi.Dict] Any)) (def: object::get diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/ruby.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/ruby.lux index d267ca612..6bf24f1fa 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/ruby.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/ruby.lux @@ -108,15 +108,15 @@ ))) (def: Nil - (for {@.ruby ffi.Nil} + (for [@.ruby ffi.Nil] Any)) (def: Object - (for {@.ruby (type (ffi.Object Any))} + (for [@.ruby (type (ffi.Object Any))] Any)) (def: Function - (for {@.ruby ffi.Function} + (for [@.ruby ffi.Function] Any)) (def: object::get diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/scheme.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/scheme.lux index 688803a33..2075522d7 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/scheme.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/scheme.lux @@ -108,12 +108,12 @@ ))) (def: Nil - (for {@.scheme - ffi.Nil} + (for [@.scheme + ffi.Nil] Any)) (def: Function - (for {@.scheme ffi.Function} + (for [@.scheme ffi.Function] Any)) (def: bundle::object diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux index e71de0758..1be1bcfa5 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux @@ -211,7 +211,7 @@ (/.install "index" (trinary ..text//index)) (/.install "size" (unary //runtime.text//size)) ... TODO: Use version below once the Lua compiler becomes self-hosted. - ... (/.install "size" (unary (for {@.lua (!unary "utf8.len")} + ... (/.install "size" (unary (for [@.lua (!unary "utf8.len")] ... (!unary "string.len")))) (/.install "char" (binary ..text//char)) (/.install "clip" (trinary ..text//clip)) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux index d2b823b85..9ed2c2624 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux @@ -342,7 +342,7 @@ (..char_index subject) ..lux_index)))))] (with_vars [byte_index] - (for {@.lua <normal>} + (for [@.lua <normal>] (_.if ..on_rembulan? <rembulan> <normal>))))) @@ -356,7 +356,7 @@ ... (_.+ (_.int +1)) (..byte_index text) (_.- (_.int +1)))))] - (for {@.lua <normal>} + (for [@.lua <normal>] (_.if ..on_rembulan? <rembulan> <normal>)))) @@ -364,7 +364,7 @@ (runtime: (text//size subject) (with_expansions [<rembulan> (_.return (_.apply/1 (_.var "string.len") subject)) <normal> (_.return (_.apply/1 (_.var "utf8.len") subject))] - (for {@.lua <normal>} + (for [@.lua <normal>] (_.if ..on_rembulan? <rembulan> <normal>)))) @@ -383,7 +383,7 @@ (_.if (_.= _.nil offset) (_.statement (_.error/1 (_.string "[Lux Error] Cannot get char from text."))) (_.return (_.apply/2 (_.var "utf8.codepoint") text offset)))))] - (for {@.lua <normal>} + (for [@.lua <normal>] (_.if ..on_rembulan? <rembulan> <normal>)))) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux index bfdf279fa..16283e2e9 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux @@ -291,7 +291,7 @@ [(_.> ..i64::+limit) ..i64::+iteration ..i64::+cap ..i64::-limit] [(_.< ..i64::-limit) ..i64::-iteration ..i64::-cap ..i64::+limit] )) - (_.return (for {@.python input} + (_.return (for [@.python input] ... This +- is only necessary to guarantee that values within the limits are always longs in Python 2 (|> input (_.+ ..i64::+limit) (_.- ..i64::+limit)))))))) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/reference.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/reference.lux index b256823f5..4913559a1 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/reference.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/reference.lux @@ -18,23 +18,23 @@ ... This universe constant is for languages where one can't just turn all compiled definitions ... into the local variables of some scoping function. (def: .public universe - (for {... In the case of Lua, there is a limit of 200 locals in a function's scope. + (for [ ... In the case of Lua, there is a limit of 200 locals in a function's scope. @.lua (not ("lua script universe")) ... Cannot make all definitions be local variables because of limitations with JRuby. @.ruby (not ("ruby script universe")) ... Cannot make all definitions be local variables because of limitations with PHP itself. @.php (not ("php script universe")) ... Cannot make all definitions be local variables because of limitations with Kawa. - @.scheme (not ("scheme script universe"))} + @.scheme (not ("scheme script universe"))] #0)) (def: universe_label Text (with_expansions [<label> (format "u" (%.nat (if ..universe 1 0)))] - (for {@.lua <label> + (for [@.lua <label> @.ruby <label> @.php <label> - @.scheme <label>} + @.scheme <label>] ""))) (def: .public (artifact [module artifact]) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux b/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux index 3df8bb802..bd1aca3b3 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/syntax.lux @@ -51,7 +51,7 @@ ["[0]" frac]]]]]) (template: (inline: <declaration> <type> <body>) - [(for {@.python (def: <declaration> <type> <body>)} + [(for [@.python (def: <declaration> <type> <body>)] (template: <declaration> [<body>]))]) ... TODO: Implement "lux syntax char case!" as a custom extension. |