From 220c804f9136c73058802575ee49f3f769d5599f Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 17 Mar 2022 04:29:59 -0400 Subject: De-sigil-ification: ! --- .github/workflows/test.yml | 29 +++-- lux-jvm/source/luxc/lang/directive/jvm.lux | 32 ++--- lux-jvm/source/luxc/lang/host/jvm.lux | 24 ++-- lux-jvm/source/luxc/lang/host/jvm/inst.lux | 4 +- .../luxc/lang/translation/jvm/extension/host.lux | 2 +- lux-lua/source/program.lux | 2 +- lux-python/source/program.lux | 8 +- stdlib/project.lux | 2 +- .../documentation/lux/control/concurrency/stm.lux | 26 ++-- .../documentation/lux/control/parser/analysis.lux | 60 ++++----- .../documentation/lux/control/parser/code.lux | 64 +++++----- .../documentation/lux/control/parser/json.lux | 32 ++--- .../documentation/lux/control/parser/synthesis.lux | 52 ++++---- .../documentation/lux/control/parser/text.lux | 24 ++-- .../documentation/lux/control/parser/type.lux | 26 ++-- stdlib/source/documentation/lux/macro/code.lux | 6 +- stdlib/source/documentation/lux/target/js.lux | 22 ++-- stdlib/source/library/lux.lux | 80 ++++++------ .../source/library/lux/abstract/monad/indexed.lux | 10 +- .../source/library/lux/control/concatenative.lux | 14 +-- .../library/lux/control/concurrency/actor.lux | 38 +++--- .../source/library/lux/control/concurrency/stm.lux | 2 +- stdlib/source/library/lux/control/exception.lux | 6 +- .../source/library/lux/control/function/inline.lux | 6 +- .../source/library/lux/control/function/mutual.lux | 8 +- stdlib/source/library/lux/control/maybe.lux | 4 +- .../source/library/lux/control/parser/analysis.lux | 20 +-- stdlib/source/library/lux/control/parser/code.lux | 30 ++--- stdlib/source/library/lux/control/parser/json.lux | 6 +- .../library/lux/control/parser/synthesis.lux | 16 +-- stdlib/source/library/lux/control/parser/text.lux | 113 +++++++++++------ stdlib/source/library/lux/control/parser/type.lux | 6 +- .../library/lux/control/security/capability.lux | 6 +- .../library/lux/data/format/css/property.lux | 2 +- .../source/library/lux/data/format/css/query.lux | 2 +- .../source/library/lux/data/format/css/value.lux | 2 +- stdlib/source/library/lux/data/format/xml.lux | 49 ++++---- stdlib/source/library/lux/debug.lux | 6 +- stdlib/source/library/lux/documentation.lux | 16 +-- stdlib/source/library/lux/extension.lux | 20 +-- stdlib/source/library/lux/ffi.jvm.lux | 140 ++++++++++----------- stdlib/source/library/lux/ffi.lux | 74 +++++------ stdlib/source/library/lux/ffi.old.lux | 140 ++++++++++----------- stdlib/source/library/lux/ffi.php.lux | 30 ++--- stdlib/source/library/lux/ffi.scm.lux | 24 ++-- stdlib/source/library/lux/ffi/export.js.lux | 4 +- stdlib/source/library/lux/ffi/export.jvm.lux | 20 +-- stdlib/source/library/lux/ffi/export.lua.lux | 4 +- stdlib/source/library/lux/ffi/export.py.lux | 4 +- stdlib/source/library/lux/ffi/export.rb.lux | 4 +- stdlib/source/library/lux/macro.lux | 6 +- stdlib/source/library/lux/macro/code.lux | 4 +- stdlib/source/library/lux/macro/pattern.lux | 6 +- stdlib/source/library/lux/macro/syntax.lux | 2 +- stdlib/source/library/lux/macro/syntax/check.lux | 2 +- .../library/lux/macro/syntax/declaration.lux | 10 +- .../source/library/lux/macro/syntax/definition.lux | 8 +- .../library/lux/macro/syntax/type/variable.lux | 4 +- stdlib/source/library/lux/macro/template.lux | 12 +- stdlib/source/library/lux/program.lux | 2 +- stdlib/source/library/lux/target/js.lux | 4 +- stdlib/source/library/lux/target/lua.lux | 2 +- stdlib/source/library/lux/target/php.lux | 2 +- stdlib/source/library/lux/target/python.lux | 2 +- stdlib/source/library/lux/target/r.lux | 2 +- stdlib/source/library/lux/target/ruby.lux | 2 +- .../language/lux/phase/extension/analysis/jvm.lux | 22 ++-- .../language/lux/phase/extension/directive/jvm.lux | 22 ++-- .../language/lux/phase/extension/directive/lux.lux | 4 +- .../lux/phase/extension/generation/jvm/host.lux | 2 +- .../lux/phase/generation/common_lisp/runtime.lux | 98 +++++++-------- .../language/lux/phase/generation/extension.lux | 4 +- .../language/lux/phase/generation/js/function.lux | 10 +- .../language/lux/phase/generation/js/runtime.lux | 20 +-- .../language/lux/phase/generation/lua/runtime.lux | 22 ++-- .../language/lux/phase/generation/php/runtime.lux | 98 +++++++-------- .../lux/phase/generation/python/runtime.lux | 20 +-- .../lux/phase/generation/r/procedure/common.lux | 4 +- .../language/lux/phase/generation/r/runtime.lux | 22 ++-- .../language/lux/phase/generation/ruby/runtime.lux | 24 ++-- .../phase/generation/scheme/extension/common.lux | 4 +- .../lux/phase/generation/scheme/runtime.lux | 100 +++++++-------- stdlib/source/library/lux/type.lux | 10 +- stdlib/source/library/lux/type/abstract.lux | 18 +-- stdlib/source/library/lux/type/implicit.lux | 6 +- stdlib/source/library/lux/type/poly.lux | 2 +- stdlib/source/library/lux/type/unit.lux | 20 +-- .../source/library/lux/world/net/http/client.lux | 2 +- stdlib/source/poly/lux/abstract/equivalence.lux | 16 +-- stdlib/source/poly/lux/abstract/functor.lux | 20 +-- stdlib/source/poly/lux/data/format/json.lux | 32 ++--- stdlib/source/program/aedifex/parser.lux | 24 ++-- stdlib/source/test/lux.lux | 22 ++-- stdlib/source/test/lux/control/concurrency/stm.lux | 54 ++++---- stdlib/source/test/lux/control/parser.lux | 2 +- stdlib/source/test/lux/control/parser/analysis.lux | 24 ++-- stdlib/source/test/lux/control/parser/code.lux | 40 +++--- stdlib/source/test/lux/control/parser/json.lux | 8 +- .../source/test/lux/control/parser/synthesis.lux | 20 +-- stdlib/source/test/lux/control/parser/text.lux | 6 +- stdlib/source/test/lux/control/parser/type.lux | 6 +- stdlib/source/test/lux/ffi.jvm.lux | 6 +- stdlib/source/test/lux/macro/code.lux | 2 +- stdlib/source/test/lux/program.lux | 2 +- stdlib/source/test/lux/target/js.lux | 14 +-- .../tool/compiler/language/lux/phase/analysis.lux | 48 +++---- .../compiler/language/lux/phase/analysis/case.lux | 12 +- .../language/lux/phase/analysis/function.lux | 8 +- stdlib/source/unsafe/lux/data/collection/array.lux | 10 +- 109 files changed, 1171 insertions(+), 1130 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 813fd5c75..6583d8129 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,25 +1,34 @@ name: test_everything on: [push] jobs: - test_stdlib: - runs-on: ubuntu-latest + setup_aedifex: steps: - uses: actions/checkout@v2 - # Setup Aedifex - run: wget https://github.com/LuxLang/lux/releases/download/0.6.5/aedifex_do_not_touch_3.jar && mv aedifex_do_not_touch_3.jar aedifex.jar - run: mv ./shell/lux.sh ./lux.sh - # Test on the JVM + - run: cd ./stdlib/ && ../lux.sh clean && cd .. + test_stdlib_on_jvm: + needs: [setup_aedifex] + runs-on: ubuntu-latest + steps: # https://github.com/actions/setup-java - uses: actions/setup-java@v2 with: distribution: 'temurin' java-version: '17' - - run: cd ./stdlib/ && ../lux.sh clean && ../lux.sh with jvm with bibliotheca test && cd .. -# # Test on Node -# - uses: actions/setup-node@v2 -# with: -# node-version: '14' -# - run: cd ./stdlib/ && ../lux.sh clean && ../lux.sh with js with bibliotheca test && cd .. + - run: cd ./stdlib/ && ../lux.sh with jvm with bibliotheca test + test_stdlib_on_node_js: + needs: [setup_aedifex] + runs-on: ubuntu-latest + steps: + # https://github.com/actions/setup-node + - uses: actions/setup-node@v2 + with: + node-version: '14' + - run: cd ./stdlib/ && ../lux.sh with js with bibliotheca test +# test_stdlib: +# runs-on: ubuntu-latest +# steps: # # Test on Lua # # https://github.com/marketplace/actions/setup-lua-luajit # - uses: xpol/setup-lua@v0.3 diff --git a/lux-jvm/source/luxc/lang/directive/jvm.lux b/lux-jvm/source/luxc/lang/directive/jvm.lux index ff0e5cecf..5f1b09ec9 100644 --- a/lux-jvm/source/luxc/lang/directive/jvm.lux +++ b/lux-jvm/source/luxc/lang/directive/jvm.lux @@ -649,26 +649,26 @@ (def: inheritance (Parser Inheritance) ($_ <>.or - (.text! "final") - (.text! "abstract") - (.text! "default") + (.this_text "final") + (.this_text "abstract") + (.this_text "default") )) (def: privacy (Parser Privacy) ($_ <>.or - (.text! "public") - (.text! "private") - (.text! "protected") - (.text! "default") + (.this_text "public") + (.this_text "private") + (.this_text "protected") + (.this_text "default") )) (def: state (Parser State) ($_ <>.or - (.text! "volatile") - (.text! "final") - (.text! "default") + (.this_text "volatile") + (.this_text "final") + (.this_text "default") )) (type: Field @@ -678,7 +678,7 @@ (Parser Field) (.form (do <>.monad - [_ (.text! "variable") + [_ (.this_text "variable") name .text privacy ..privacy state ..state @@ -763,7 +763,7 @@ (<>.and ..value .any)))] (<| .form - (<>.after (.text! "init")) + (<>.after (.this_text "init")) ($_ <>.and ..privacy .bit @@ -779,7 +779,7 @@ (def: override (Parser (Override Code)) (<| .form - (<>.after (.text! "override")) + (<>.after (.this_text "override")) ($_ <>.and ..class_declaration .text @@ -796,7 +796,7 @@ (def: virtual (Parser (Virtual Code)) (<| .form - (<>.after (.text! "virtual")) + (<>.after (.this_text "virtual")) ($_ <>.and .text ..privacy @@ -814,7 +814,7 @@ (def: static (Parser (Static Code)) (<| .form - (<>.after (.text! "static")) + (<>.after (.this_text "static")) ($_ <>.and .text ..privacy @@ -830,7 +830,7 @@ (def: abstract (Parser Abstract) (<| .form - (<>.after (.text! "abstract")) + (<>.after (.this_text "abstract")) ($_ <>.and .text ..privacy diff --git a/lux-jvm/source/luxc/lang/host/jvm.lux b/lux-jvm/source/luxc/lang/host/jvm.lux index dc942529d..22d901d51 100644 --- a/lux-jvm/source/luxc/lang/host/jvm.lux +++ b/lux-jvm/source/luxc/lang/host/jvm.lux @@ -94,20 +94,20 @@ (type: .public (Generator i) (-> Phase Archive i (Operation Inst))) -(syntax: (config: [type .local_symbol - none .local_symbol - ++ .local_symbol - options (.tuple (<>.many .local_symbol))]) - (let [g!type (code.local_symbol type) - g!none (code.local_symbol none) - g!tags+ (list#each (|>> (format "#") code.local_symbol) options) - g!_left (code.local_symbol "_left") - g!_right (code.local_symbol "_right") +(syntax: (config: [type .local + none .local + ++ .local + options (.tuple (<>.many .local))]) + (let [g!type (code.local type) + g!none (code.local none) + g!tags+ (list#each (|>> (format "#") code.local) options) + g!_left (code.local "_left") + g!_right (code.local "_right") g!options+ (list#each (function (_ option) - (` (def: .public (~ (code.local_symbol option)) + (` (def: .public (~ (code.local option)) (~ g!type) (|> (~ g!none) - (has (~ (code.local_symbol (format "#" option))) #1))))) + (has (~ (code.local (format "#" option))) #1))))) options)] (in (list& (` (type: .public (~ g!type) (.Record @@ -125,7 +125,7 @@ list#conjoint code.tuple)))) - (` (def: .public ((~ (code.local_symbol ++)) (~ g!_left) (~ g!_right)) + (` (def: .public ((~ (code.local ++)) (~ g!_left) (~ g!_right)) (-> (~ g!type) (~ g!type) (~ g!type)) (~ (|> g!tags+ (list#each (function (_ tag) diff --git a/lux-jvm/source/luxc/lang/host/jvm/inst.lux b/lux-jvm/source/luxc/lang/host/jvm/inst.lux index 8b75e4169..34074c43c 100644 --- a/lux-jvm/source/luxc/lang/host/jvm/inst.lux +++ b/lux-jvm/source/luxc/lang/host/jvm/inst.lux @@ -47,9 +47,9 @@ (import: java/lang/String "[1]::[0]") -(syntax: (declare [codes (p.many s.local_symbol)]) +(syntax: (declare [codes (p.many s.local)]) (|> codes - (list@each (function (_ code) (` ((~' "static") (~ (code.local_symbol code)) (~' int))))) + (list@each (function (_ code) (` ((~' "static") (~ (code.local code)) (~' int))))) in)) (`` (import: org/objectweb/asm/Opcodes diff --git a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux index 820e230db..91b664b54 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux @@ -859,7 +859,7 @@ (Parser [(Environment Synthesis) (/.Overriden_Method Synthesis)]) (.tuple (do <>.monad - [_ (.text! /.overriden_tag) + [_ (.this_text /.overriden_tag) ownerT ..class name .text strict_fp? .bit diff --git a/lux-lua/source/program.lux b/lux-lua/source/program.lux index 3bcf4ccf9..46fb33033 100644 --- a/lux-lua/source/program.lux +++ b/lux-lua/source/program.lux @@ -272,7 +272,7 @@ (def: input/* (-> Nat (List Code)) (|>> list.indices - (list#each (|>> %.nat (format "input/") code.local_symbol)))) + (list#each (|>> %.nat (format "input/") code.local)))) (def: declaration/* (-> Nat (List Code)) diff --git a/lux-python/source/program.lux b/lux-python/source/program.lux index 513de48f0..b821f62c3 100644 --- a/lux-python/source/program.lux +++ b/lux-python/source/program.lux @@ -274,9 +274,9 @@ (as org/python/core/PyObject self) (~~ (template [] - [(pattern (list (~~ (static.literals code.local_symbol (inputs/? ))))) + [(pattern (list (~~ (static.literals code.local (inputs/? ))))) (to_host ((as (~~ (static.literal function.identity (function/? ))) it) - (~~ (static.literals code.local_symbol (inputs/? )))))] + (~~ (static.literals code.local (inputs/? )))))] [1] [2] @@ -287,10 +287,10 @@ [7] [8])) - (pattern (list& (~~ (static.literals code.local_symbol (inputs/? 8))) + (pattern (list& (~~ (static.literals code.local (inputs/? 8))) input/+)) (again ((as (~~ (static.literal function.identity (function/? 8))) it) - (~~ (static.literals code.local_symbol (inputs/? 8)))) + (~~ (static.literals code.local (inputs/? 8)))) input/+)))))))))))) (def: object_class diff --git a/stdlib/project.lux b/stdlib/project.lux index 52d7f9560..370f8c85f 100644 --- a/stdlib/project.lux +++ b/stdlib/project.lux @@ -57,7 +57,7 @@ ] "js" - ["lux" ["com.github.luxlang" "lux-js" "0.6.6-SNAPSHOT" "js"] + ["lux" ["com.github.luxlang" "lux-js" "0.7.0-SNAPSHOT" "js"] ... The OS command to use when running JS tests. The default is described below. ... "js" ["node" "--stack_size=8192"] ] diff --git a/stdlib/source/documentation/lux/control/concurrency/stm.lux b/stdlib/source/documentation/lux/control/concurrency/stm.lux index 662bd2768..1d2c75baa 100644 --- a/stdlib/source/documentation/lux/control/concurrency/stm.lux +++ b/stdlib/source/documentation/lux/control/concurrency/stm.lux @@ -1,14 +1,14 @@ (.using - [library - [lux {"-" if loop} - ["$" documentation {"+" documentation:}] - [data - [text {"+" \n} - ["%" format {"+" format}]]] - [macro - ["[0]" template]]]] - [\\library - ["[0]" /]]) + [library + [lux {"-" if loop} + ["$" documentation {"+" documentation:}] + [data + [text {"+" \n} + ["%" format {"+" format}]]] + [macro + ["[0]" template]]]] + [\\library + ["[0]" /]]) (documentation: (/.Var it) "A mutable cell containing a value, and observers that will be alerted of any change to it.") @@ -17,9 +17,9 @@ "Creates a new STM var, with a default value." [(var value)]) -(documentation: /.follow! +(documentation: /.changes "Creates a channel that will receive all changes to the value of the given var." - [(follow! target)]) + [(changes target)]) (documentation: (/.STM it) "A computation which updates a transaction and produces a value.") @@ -40,7 +40,7 @@ "" [..Var ..var - ..follow! + ..changes ..STM ..update ..commit! diff --git a/stdlib/source/documentation/lux/control/parser/analysis.lux b/stdlib/source/documentation/lux/control/parser/analysis.lux index a9c481f0a..c2a58f279 100644 --- a/stdlib/source/documentation/lux/control/parser/analysis.lux +++ b/stdlib/source/documentation/lux/control/parser/analysis.lux @@ -1,14 +1,14 @@ (.using - [library - [lux {"-" nat int rev local} - ["$" documentation {"+" documentation:}] - [data - [text {"+" \n} - ["%" format {"+" format}]]] - [macro - ["[0]" template]]]] - [\\library - ["[0]" /]]) + [library + [lux {"-" nat int rev local} + ["$" documentation {"+" documentation:}] + [data + [text {"+" \n} + ["%" format {"+" format}]]] + [macro + ["[0]" template]]]] + [\\library + ["[0]" /]]) (documentation: (/.Parser it) "A parser for Lux code analysis nodes.") @@ -20,7 +20,7 @@ (documentation: /.any "Matches any value, without discrimination.") -(documentation: /.end! +(documentation: /.end "Ensures there are no more inputs.") (documentation: /.end? @@ -32,15 +32,15 @@ (`` (documentation: (format "Assert a specific " (~~ (template.text [])) " value.")))))] - [/.bit /.bit!] - [/.nat /.nat!] - [/.int /.int!] - [/.rev /.rev!] - [/.frac /.frac!] - [/.text /.text!] - [/.local /.local!] - [/.foreign /.foreign!] - [/.constant /.constant!] + [/.bit /.this_bit] + [/.nat /.this_nat] + [/.int /.this_int] + [/.rev /.this_rev] + [/.frac /.this_frac] + [/.text /.this_text] + [/.local /.this_local] + [/.foreign /.this_foreign] + [/.constant /.this_constant] ) (documentation: /.tuple @@ -54,17 +54,17 @@ [..Parser ..result ..any - ..end! + ..end ..end? - ..bit ..bit! - ..nat ..nat! - ..int ..int! - ..rev ..rev! - ..frac ..frac! - ..text ..text! - ..local ..local! - ..foreign ..foreign! - ..constant ..constant! + ..bit ..this_bit + ..nat ..this_nat + ..int ..this_int + ..rev ..this_rev + ..frac ..this_frac + ..text ..this_text + ..local ..this_local + ..foreign ..this_foreign + ..constant ..this_constant ..tuple ($.default /.cannot_parse) ($.default /.unconsumed_input)] diff --git a/stdlib/source/documentation/lux/control/parser/code.lux b/stdlib/source/documentation/lux/control/parser/code.lux index c2a4cf27f..e11fb64b8 100644 --- a/stdlib/source/documentation/lux/control/parser/code.lux +++ b/stdlib/source/documentation/lux/control/parser/code.lux @@ -1,14 +1,14 @@ (.using - [library - [lux {"-" nat int rev local not symbol} - ["$" documentation {"+" documentation:}] - [data - [text {"+" \n} - ["%" format {"+" format}]]] - [macro - ["[0]" template]]]] - [\\library - ["[0]" /]]) + [library + [lux {"-" nat int rev local not symbol} + ["$" documentation {"+" documentation:}] + [data + [text {"+" \n} + ["%" format {"+" format}]]] + [macro + ["[0]" template]]]] + [\\library + ["[0]" /]]) (documentation: (/.Parser it) "A Lux code parser.") @@ -22,18 +22,18 @@ (`` (documentation: (format "Checks for a specific " (~~ (template.text [])) " input.")))] - [/.bit /.bit!] - [/.nat /.nat!] - [/.int /.int!] - [/.rev /.rev!] - [/.frac /.frac!] - [/.text /.text!] - [/.symbol /.symbol!] + [/.bit /.this_bit] + [/.nat /.this_nat] + [/.int /.this_int] + [/.rev /.this_rev] + [/.frac /.this_frac] + [/.text /.this_text] + [/.symbol /.this_symbol] ) -(documentation: /.this! +(documentation: /.this "Ensures the given Code is the next input." - [(this! code)]) + [(this code)]) (template [ ] [(documentation: @@ -41,7 +41,7 @@ (documentation: (format "Checks for a specific local " " (a " " that has no module prefix)."))] - [/.local_symbol /.local_symbol! "local symbol"] + [/.local /.this_local "local symbol"] ) (template [] @@ -53,7 +53,7 @@ [/.tuple] ) -(documentation: /.end! +(documentation: /.end "Verifies there are no more inputs.") (documentation: /.end? @@ -82,30 +82,30 @@ ..any ..bit - ..bit! + ..this_bit ..nat - ..nat! + ..this_nat ..int - ..int! + ..this_int ..rev - ..rev! + ..this_rev ..frac - ..frac! + ..this_frac ..text - ..text! + ..this_text ..symbol - ..symbol! + ..this_symbol - ..this! + ..this - ..local_symbol - ..local_symbol! + ..local + ..this_local ..form ..tuple ..variant - ..end! + ..end ..end? ..result ..local diff --git a/stdlib/source/documentation/lux/control/parser/json.lux b/stdlib/source/documentation/lux/control/parser/json.lux index a9471ef9f..714fd3326 100644 --- a/stdlib/source/documentation/lux/control/parser/json.lux +++ b/stdlib/source/documentation/lux/control/parser/json.lux @@ -1,14 +1,14 @@ (.using - [library - [lux "*" - ["$" documentation {"+" documentation:}] - [data - [text {"+" \n} - ["%" format {"+" format}]]] - [macro - ["[0]" template]]]] - [\\library - ["[0]" /]]) + [library + [lux "*" + ["$" documentation {"+" documentation:}] + [data + [text {"+" \n} + ["%" format {"+" format}]]] + [macro + ["[0]" template]]]] + [\\library + ["[0]" /]]) (documentation: (/.Parser it) "A JSON parser.") @@ -37,9 +37,9 @@ (`` (documentation: (format "Ensures a JSON value is a " (~~ (template.text [])) ".")))] - [/.boolean? /.boolean! ..boolean] - [/.number? /.number! ..number] - [/.string? /.string! ..string] + [/.boolean? /.this_boolean ..boolean] + [/.number? /.this_number ..number] + [/.string? /.this_string ..string] ) (documentation: /.nullable @@ -76,9 +76,9 @@ ..number ..string - ..boolean? ..boolean! - ..number? ..number! - ..string? ..string! + ..boolean? ..this_boolean + ..number? ..this_number + ..string? ..this_string ..nullable ..array diff --git a/stdlib/source/documentation/lux/control/parser/synthesis.lux b/stdlib/source/documentation/lux/control/parser/synthesis.lux index 272ce901a..498b88d96 100644 --- a/stdlib/source/documentation/lux/control/parser/synthesis.lux +++ b/stdlib/source/documentation/lux/control/parser/synthesis.lux @@ -1,14 +1,14 @@ (.using - [library - [lux {"-" i64 local function loop} - ["$" documentation {"+" documentation:}] - [data - [text {"+" \n} - ["%" format {"+" format}]]] - [macro - ["[0]" template]]]] - [\\library - ["[0]" /]]) + [library + [lux {"-" i64 local function loop} + ["$" documentation {"+" documentation:}] + [data + [text {"+" \n} + ["%" format {"+" format}]]] + [macro + ["[0]" template]]]] + [\\library + ["[0]" /]]) (documentation: (/.Parser it) "A parser for the Lux compiler's synthesis nodes using during optimization.") @@ -21,7 +21,7 @@ (documentation: /.any "Yields a synthesis node without subjecting it to any analysis.") -(documentation: /.end! +(documentation: /.end "Ensures there are no more inputs.") (documentation: /.end? @@ -33,13 +33,13 @@ (`` (documentation: (format "Checks for a specific " (~~ (template.text [])) " synthesis node.")))] - [/.bit /.bit!] - [/.i64 /.i64!] - [/.f64 /.f64!] - [/.text /.text!] - [/.local /.local!] - [/.foreign /.foreign!] - [/.constant /.constant!] + [/.bit /.this_bit] + [/.i64 /.this_i64] + [/.f64 /.this_f64] + [/.text /.this_text] + [/.local /.this_local] + [/.foreign /.this_foreign] + [/.constant /.this_constant] ) (documentation: /.tuple @@ -61,16 +61,16 @@ [..Parser ..result ..any - ..end! + ..end ..end? - ..bit ..bit! - ..i64 ..i64! - ..f64 ..f64! - ..text ..text! - ..local ..local! - ..foreign ..foreign! - ..constant ..constant! + ..bit ..this_bit + ..i64 ..this_i64 + ..f64 ..this_f64 + ..text ..this_text + ..local ..this_local + ..foreign ..this_foreign + ..constant ..this_constant ..tuple ..function diff --git a/stdlib/source/documentation/lux/control/parser/text.lux b/stdlib/source/documentation/lux/control/parser/text.lux index 415090625..1859f451c 100644 --- a/stdlib/source/documentation/lux/control/parser/text.lux +++ b/stdlib/source/documentation/lux/control/parser/text.lux @@ -1,14 +1,14 @@ (.using - [library - [lux {"-" and not local} - ["$" documentation {"+" documentation:}] - [data - [text {"+" \n} - ["%" format {"+" format}]]] - [macro - ["[0]" template]]]] - [\\library - ["[0]" /]]) + [library + [lux {"-" and not local} + ["$" documentation {"+" documentation:}] + [data + [text {"+" \n} + ["%" format {"+" format}]]] + [macro + ["[0]" template]]]] + [\\library + ["[0]" /]]) (documentation: /.Offset "An offset into a block of text.") @@ -45,7 +45,7 @@ "Checks that a specific text shows up in the input." [(this reference)]) -(documentation: /.end! +(documentation: /.end "Ensure the parser's input is empty.") (documentation: /.next @@ -167,7 +167,7 @@ ..not ..not! ..this - ..end! + ..end ..next ..remaining ..range diff --git a/stdlib/source/documentation/lux/control/parser/type.lux b/stdlib/source/documentation/lux/control/parser/type.lux index 8d0a45401..331f109de 100644 --- a/stdlib/source/documentation/lux/control/parser/type.lux +++ b/stdlib/source/documentation/lux/control/parser/type.lux @@ -1,14 +1,14 @@ (.using - [library - [lux {"-" local function} - ["$" documentation {"+" documentation:}] - [data - [text {"+" \n} - ["%" format {"+" format}]]] - [macro - ["[0]" template]]]] - [\\library - ["[0]" /]]) + [library + [lux {"-" local function} + ["$" documentation {"+" documentation:}] + [data + [text {"+" \n} + ["%" format {"+" format}]]] + [macro + ["[0]" template]]]] + [\\library + ["[0]" /]]) (documentation: /.Env "An environment for type parsing.") @@ -74,9 +74,9 @@ "" [(adjusted_idx env idx)]) -(documentation: /.parameter! +(documentation: /.this_parameter "" - [(parameter! id)]) + [(this_parameter id)]) (documentation: /.existential "Yields an existential type.") @@ -115,7 +115,7 @@ ..super ..adjusted_idx - ..parameter! + ..this_parameter ..existential ..named ..recursive diff --git a/stdlib/source/documentation/lux/macro/code.lux b/stdlib/source/documentation/lux/macro/code.lux index ed5ebdc2b..1a824238f 100644 --- a/stdlib/source/documentation/lux/macro/code.lux +++ b/stdlib/source/documentation/lux/macro/code.lux @@ -1,6 +1,6 @@ (.using [library - [lux {"-" char} + [lux {"-" char local global} ["$" documentation {"+" documentation:}] [data [text @@ -10,7 +10,7 @@ [\\library ["[0]" /]]) -(documentation: /.local_symbol +(documentation: /.local "Produces a local symbol (an symbol with no module prefix).") (documentation: /.replaced @@ -21,7 +21,7 @@ (.List $.Module) ($.module /._ "" - [..local_symbol + [..local ..replaced ($.default /.bit) ($.default /.nat) diff --git a/stdlib/source/documentation/lux/target/js.lux b/stdlib/source/documentation/lux/target/js.lux index a7f688353..4a87b312a 100644 --- a/stdlib/source/documentation/lux/target/js.lux +++ b/stdlib/source/documentation/lux/target/js.lux @@ -1,14 +1,14 @@ (.using - [library - [lux {"-" char} - ["$" documentation {"+" documentation:}] - [data - [text {"+" \n} - ["%" format {"+" format}]] - [collection - ["[0]" list]]]]] - [\\library - ["[0]" /]]) + [library + [lux {"-" char} + ["$" documentation {"+" documentation:}] + [data + [text {"+" \n} + ["%" format {"+" format}]] + [collection + ["[0]" list]]]]] + [\\library + ["[0]" /]]) (.def: .public documentation (.List $.Module) @@ -39,7 +39,7 @@ ($.default /.object) ($.default /.,) ($.default /.then) - ($.default /.function!) + ($.default /.function_definition) ($.default /.function) ($.default /.closure) ($.default /.=) diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux index df53c5058..7cc43774e 100644 --- a/stdlib/source/library/lux.lux +++ b/stdlib/source/library/lux.lux @@ -341,7 +341,7 @@ ([_ name] (_ann {#Symbol name}))) #0) -("lux def" local_symbol$ +("lux def" local$ ("lux type check" {#Function Text Code} ([_ name] (_ann {#Symbol ["" name]}))) #0) @@ -965,13 +965,13 @@ (def:'' .private quantified {#Function Code Code} - (let$ (local_symbol$ ..quantification_level) (nat$ 0))) + (let$ (local$ ..quantification_level) (nat$ 0))) (def:'' .private (quantified_type_parameter idx) {#Function Nat Code} (variant$ {#Item (symbol$ [..prelude_module "#Parameter"]) {#Item (form$ {#Item (text$ "lux i64 +") - {#Item (local_symbol$ ..quantification_level) + {#Item (local$ ..quantification_level) {#Item (nat$ idx) {#End}}}}) {#End}}})) @@ -1041,7 +1041,7 @@ (def:'' .private (with_correct_quantification body) {#Function Code Code} (form$ {#Item (symbol$ [prelude_module "__adjusted_quantified_type__"]) - {#Item (local_symbol$ ..quantification_level) + {#Item (local$ ..quantification_level) {#Item (nat$ 0) {#Item body {#End}}}}})) @@ -1058,7 +1058,7 @@ depth)))) {#End}}}}) body)} - (local_symbol$ ..quantification_level))) + (local$ ..quantification_level))) (def:'' .private (initialized_quantification? lux) {#Function Lux Bit} @@ -1205,10 +1205,10 @@ (failure "function' requires a non-empty arguments tuple.") {#Item [harg targs]} - (meta#in (list (form$ (list (tuple$ (list (local_symbol$ name) + (meta#in (list (form$ (list (tuple$ (list (local$ name) harg)) (list#mix (function'' [arg body'] - (form$ (list (tuple$ (list (local_symbol$ "") + (form$ (list (tuple$ (list (local$ "") arg)) body'))) body @@ -1412,15 +1412,15 @@ (macro:' .private (do tokens) ({{#Item monad {#Item [_ {#Tuple bindings}] {#Item body {#End}}}} ({{#Some bindings} - (let' [g!in (local_symbol$ "in") - g!then (local_symbol$ " then ") + (let' [g!in (local$ "in") + g!then (local$ " then ") body' (list#mix ("lux type check" (-> (Tuple Code Code) Code Code) (function' [binding body'] (let' [[var value] binding] ({[_ {#Symbol [module short]}] ({"" (form$ (list g!then - (form$ (list (tuple$ (list (local_symbol$ "") var)) body')) + (form$ (list (tuple$ (list (local$ "") var)) body')) value)) _ @@ -1430,7 +1430,7 @@ _ (form$ (list g!then - (form$ (list (tuple$ (list (local_symbol$ "") var)) body')) + (form$ (list (tuple$ (list (local$ "") var)) body')) value))} var)))) body @@ -2360,12 +2360,12 @@ ..#seed ("lux i64 +" 1 seed) ..#expected expected ..#location location ..#extensions extensions ..#scope_type_vars scope_type_vars ..#eval _eval] - (local_symbol$ ($_ text#composite "__gensym__" prefix (nat#encoded seed)))}} + (local$ ($_ text#composite "__gensym__" prefix (nat#encoded seed)))}} state)) (macro:' .public (exec tokens) ({{#Item value actions} - (let' [dummy (local_symbol$ "")] + (let' [dummy (local$ "")] (meta#in (list (list#mix ("lux type check" (-> Code Code Code) (function' [pre post] (` ({(~ dummy) (~ post)} (~ pre))))) @@ -2528,7 +2528,7 @@ _ {#None})) {#Some g!name head tail body} - (let [g!blank (local_symbol$ "") + (let [g!blank (local$ "") nest (is (-> Code (-> Code Code Code)) (function' [g!name] (function' [arg body'] @@ -2536,7 +2536,7 @@ (` ([(~ g!name) (~ arg)] (~ body'))) (` ([(~ g!name) (~ g!blank)] (.case (~ g!blank) (~ arg) (~ body'))))))))] - (meta#in (list (nest (..local_symbol$ g!name) head + (meta#in (list (nest (..local$ g!name) head (list#mix (nest g!blank) body (list#reversed tail)))))) {#None} @@ -2633,11 +2633,11 @@ _ {#None})) -(def:' .private (local_symbolP tokens) +(def:' .private (localP tokens) (-> (List Code) (Maybe [(List Code) Text])) (case tokens - (pattern (list& [_ {#Symbol ["" local_symbol]}] tokens')) - {#Some [tokens' local_symbol]} + (pattern (list& [_ {#Symbol ["" local]}] tokens')) + {#Some [tokens' local]} _ {#None})) @@ -2656,7 +2656,7 @@ tail ( tokens)] (in {#Item head tail}))))] - [parametersP Text local_symbolP] + [parametersP Text localP] [enhanced_parametersP Code anyP] ) @@ -2666,14 +2666,14 @@ (case tokens (pattern (list& [_ {#Form local_declaration}] tokens')) (do maybe_monad - [% (local_symbolP local_declaration) + [% (localP local_declaration) .let' [[local_declaration name] %] parameters ( local_declaration)] (in [tokens' [name parameters]])) _ (do maybe_monad - [% (local_symbolP tokens) + [% (localP tokens) .let' [[tokens' name] %]] (in [tokens' [name {#End}]]))))] @@ -2746,7 +2746,7 @@ body _ - (` (function ((~ (..local_symbol$ name)) (~+ parameters)) + (` (function ((~ (..local$ name)) (~+ parameters)) (~ body)))) body (case ?type {#Some type} @@ -2755,7 +2755,7 @@ {#None} body)] - (meta#in (list (` ("lux def" (~ (..local_symbol$ name)) + (meta#in (list (` ("lux def" (~ (..local$ name)) (~ body) (~ export_policy)))))) @@ -2775,14 +2775,14 @@ (macro:' .public (macro: tokens) (case (macroP tokens) {#Some [export_policy name args body]} - (let [name (local_symbol$ name) + (let [name (local$ name) body (case args {#End} body _ (` ("lux macro" - (function ((~ name) (~+ (list#each local_symbol$ args))) (~ body)))))] + (function ((~ name) (~+ (list#each local$ args))) (~ body)))))] (meta#in (list (` ("lux def" (~ name) (~ body) (~ export_policy)))))) @@ -3192,10 +3192,10 @@ {#Some [export_policy name args type definitions]} (let [usage (case args {#End} - (local_symbol$ name) + (local$ name) _ - (` ((~ (local_symbol$ name)) (~+ args))))] + (` ((~ (local$ name)) (~+ args))))] (meta#in (list (` (..def: (~ export_policy) (~ usage) (~ type) (..implementation @@ -3334,7 +3334,7 @@ (do meta_monad [type+labels?? (..type_declaration type_codes) module_name current_module_name - .let' [type_name (local_symbol$ name) + .let' [type_name (local$ name) [type labels??] type+labels?? type' (is (Maybe Code) (case args @@ -3342,7 +3342,7 @@ {#Some type} _ - {#Some (` (.All ((~ type_name) (~+ (list#each local_symbol$ args))) + {#Some (` (.All ((~ type_name) (~+ (list#each local$ args))) (~ type)))}))]] (case type' {#Some type''} @@ -4021,7 +4021,7 @@ (do meta_monad [output (record_slots type) g!_ (..generated_symbol "g!_") - .let [g!output (local_symbol$ short) + .let [g!output (local$ short) pattern (|> tags enumeration (list#each (function (_ [tag_idx tag]) @@ -4041,7 +4041,7 @@ (meta#in (list#conjoint decls'))) _ - (meta#in (list (` ("lux def" (~ (local_symbol$ (..module_alias (list short) alias))) + (meta#in (list (` ("lux def" (~ (local$ (..module_alias (list short) alias))) (~ source+) #0))))))) @@ -4150,7 +4150,7 @@ (in (list))) .let [defs (list#each (is (-> Text Code) (function (_ def) - (` ("lux def alias" (~ (local_symbol$ def)) (~ (symbol$ [module_name def])))))) + (` ("lux def alias" (~ (local$ def)) (~ (symbol$ [module_name def])))))) defs') openings (|> r_opens (list#each (is (-> Openings (List Code)) @@ -4180,10 +4180,10 @@ (list (' "*")) {#Only defs} - (list (variant$ (list& (' "+") (list#each local_symbol$ defs)))) + (list (variant$ (list& (' "+") (list#each local$ defs)))) {#Exclude defs} - (list (variant$ (list& (' "-") (list#each local_symbol$ defs)))) + (list (variant$ (list& (' "-") (list#each local$ defs)))) {#Ignore} (list) @@ -4192,7 +4192,7 @@ (list))) openings (list#each (function (_ [alias structs]) (form$ (list& (text$ (..module_alias (list (alias_stand_in 0) module_alias) alias)) - (list#each local_symbol$ structs)))) + (list#each local$ structs)))) r_opens)] (` ((~! ..refer) (~ (text$ module_name)) (~+ localizations) @@ -4453,7 +4453,7 @@ {#Some [name bindings body]} (pattern (list [_ {#Tuple bindings}] body)) - {#Some [(local_symbol$ "again") bindings body]} + {#Some [(local$ "again") bindings body]} _ {#None})] @@ -4775,13 +4775,13 @@ g!compiler (..generated_symbol "compiler") g!_ (..generated_symbol "_") .let [rep_env (list#each (function (_ arg) - [arg (` ((~' ~) (~ (local_symbol$ arg))))]) + [arg (` ((~' ~) (~ (local$ arg))))]) args)] this_module current_module_name] (in (list (` (macro: (~ export_policy) - ((~ (local_symbol$ name)) (~ g!tokens) (~ g!compiler)) + ((~ (local$ name)) (~ g!tokens) (~ g!compiler)) (case (~ g!tokens) - (pattern (list (~+ (list#each local_symbol$ args)))) + (pattern (list (~+ (list#each local$ args)))) {.#Right [(~ g!compiler) (list (~+ (list#each (function (_ template) (` (`' (~ (with_replacements rep_env @@ -5013,7 +5013,7 @@ (-> Code Code Text Code Code) (` {.#Apply (..Primitive "") (.All ((~ g!self) (~ g!dummy)) - (~ (let$ (local_symbol$ name) (` {.#Apply (..Primitive "") (~ g!self)}) + (~ (let$ (local$ name) (` {.#Apply (..Primitive "") (~ g!self)}) body)))})) (macro: .public (Rec tokens) diff --git a/stdlib/source/library/lux/abstract/monad/indexed.lux b/stdlib/source/library/lux/abstract/monad/indexed.lux index a6b99afc4..fb6371bad 100644 --- a/stdlib/source/library/lux/abstract/monad/indexed.lux +++ b/stdlib/source/library/lux/abstract/monad/indexed.lux @@ -1,6 +1,6 @@ (.using [library - [lux "*" + [lux {"-" global} [control ["<>" parser ["<[0]>" code {"+" Parser}]]] @@ -36,7 +36,7 @@ {#Macro Symbol Code} {#Binding Binding})) -(def: global_symbol +(def: global (Parser Symbol) (//.do <>.monad [[module short] .symbol @@ -45,7 +45,7 @@ (def: context (Parser Context) - (<>.or (<>.and ..global_symbol + (<>.or (<>.and ..global .any) binding)) @@ -56,7 +56,7 @@ (def: named_monad (Parser [(Maybe Text) Code]) (<>.either (.tuple (<>.and (# <>.monad each (|>> {.#Some}) - .local_symbol) + .local) .any)) (# <>.monad each (|>> [{.#None}]) .any))) @@ -81,7 +81,7 @@ (list.reversed context))] (in (list (case ?name {.#Some name} - (let [name (code.local_symbol name)] + (let [name (code.local name)] (` (let [(~ name) (~ monad) [..in (~' in) ..then (~ g!then)] (~ name)] diff --git a/stdlib/source/library/lux/control/concatenative.lux b/stdlib/source/library/lux/control/concatenative.lux index c4bf4c544..0f01c8d9f 100644 --- a/stdlib/source/library/lux/control/concatenative.lux +++ b/stdlib/source/library/lux/control/concatenative.lux @@ -36,7 +36,7 @@ (def: aliases^ (Parser (List Alias)) - (|> (<>.and .local_symbol .any) + (|> (<>.and .local .any) <>.some .tuple)) @@ -82,7 +82,7 @@ (syntax: .public (=> [[aliases inputs outputs] signature^]) (let [de_alias (function (_ aliased) (list#mix (function (_ [from to] pre) - (code.replaced (code.local_symbol from) to pre)) + (code.replaced (code.local from) to pre)) aliased aliases))] (case [(the #bottom inputs) @@ -104,28 +104,28 @@ (-> (~ (de_alias inputC)) (~ (de_alias outputC))))))))))))) -(def: begin! +(def: beginning Any []) -(def: end! +(def: end (All (_ a) (-> [Any a] a)) (function (_ [_ top]) top)) (syntax: .public (||> [commands (<>.some .any)]) - (in (list (` (|> (~! ..begin!) (~+ commands) ((~! ..end!))))))) + (in (list (` (|> (~! ..beginning) (~+ commands) ((~! ..end))))))) (def: word (Parser [Code Text Code (List Code)]) (|export|.parser ($_ <>.and - .local_symbol + .local .any (<>.many .any)))) (syntax: .public (word: [[export_policy name type commands] ..word]) - (in (list (` (def: (~ export_policy) (~ (code.local_symbol name)) + (in (list (` (def: (~ export_policy) (~ (code.local name)) (~ type) (|>> (~+ commands))))))) diff --git a/stdlib/source/library/lux/control/concurrency/actor.lux b/stdlib/source/library/lux/control/concurrency/actor.lux index bdb3db4ce..715b2b98f 100644 --- a/stdlib/source/library/lux/control/concurrency/actor.lux +++ b/stdlib/source/library/lux/control/concurrency/actor.lux @@ -213,8 +213,8 @@ (def: actor_decl^ (Parser [Text (List Text)]) - (<>.either (.form (<>.and .local_symbol (<>.some .local_symbol))) - (<>.and .local_symbol (# <>.monad in (list))))) + (<>.either (.form (<>.and .local (<>.some .local))) + (<>.and .local (# <>.monad in (list))))) (type: On_MailC [[Text Text Text] Code]) @@ -224,11 +224,11 @@ (def: argument (Parser Text) - .local_symbol) + .local) (def: on_mail^ (Parser (Maybe On_MailC)) - (<>.maybe (.form (<>.and (.form (<>.after (.this! (' on_mail)) + (<>.maybe (.form (<>.and (.form (<>.after (.this (' on_mail)) ($_ <>.and ..argument ..argument ..argument))) .any)))) @@ -246,9 +246,9 @@ {.#Some [[mailN stateN selfN] bodyC]} (` (function ((~ g!_) - (~ (code.local_symbol mailN)) - (~ (code.local_symbol stateN)) - (~ (code.local_symbol selfN))) + (~ (code.local mailN)) + (~ (code.local stateN)) + (~ (code.local selfN))) (~ bodyC))))) (def: actorP @@ -263,8 +263,8 @@ (with_symbols [g!_] (do meta.monad [g!type (macro.symbol (format name "_abstract_type")) - .let [g!actor (code.local_symbol name) - g!vars (list#each code.local_symbol vars)]] + .let [g!actor (code.local name) + g!vars (list#each code.local vars)]] (in (list (` ((~! abstract:) (~ export_policy) ((~ g!type) (~+ g!vars)) (~ state_type) @@ -297,15 +297,15 @@ (def: signature^ (Parser Signature) (.form ($_ <>.and - (<>.else (list) (.tuple (<>.some .local_symbol))) - .local_symbol + (<>.else (list) (.tuple (<>.some .local))) + .local |input|.parser - .local_symbol - .local_symbol))) + .local + .local))) (def: reference^ (Parser [Symbol (List Text)]) - (<>.either (.form (<>.and .symbol (<>.some .local_symbol))) + (<>.either (.form (<>.and .symbol (<>.some .local))) (<>.and .symbol (# <>.monad in (list))))) (def: messageP @@ -320,14 +320,14 @@ (with_symbols [g!_ g!return] (do meta.monad [actor_scope abstract.current - .let [g!type (code.local_symbol (the abstract.#name actor_scope)) - g!message (code.local_symbol (the #name signature)) + .let [g!type (code.local (the abstract.#name actor_scope)) + g!message (code.local (the #name signature)) g!actor_vars (the abstract.#type_vars actor_scope) - g!all_vars (|> signature (the #vars) (list#each code.local_symbol) (list#composite g!actor_vars)) + g!all_vars (|> signature (the #vars) (list#each code.local) (list#composite g!actor_vars)) g!inputsC (|> signature (the #inputs) (list#each product.left)) g!inputsT (|> signature (the #inputs) (list#each product.right)) - g!state (|> signature (the #state) code.local_symbol) - g!self (|> signature (the #self) code.local_symbol)]] + g!state (|> signature (the #state) code.local) + g!self (|> signature (the #self) code.local)]] (in (list (` (def: (~ export_policy) ((~ g!message) (~+ g!inputsC)) (All ((~ g!_) (~+ g!all_vars)) (-> (~+ g!inputsT) diff --git a/stdlib/source/library/lux/control/concurrency/stm.lux b/stdlib/source/library/lux/control/concurrency/stm.lux index 3668a2e9c..9935069d9 100644 --- a/stdlib/source/library/lux/control/concurrency/stm.lux +++ b/stdlib/source/library/lux/control/concurrency/stm.lux @@ -65,7 +65,7 @@ (in [])) (write! new_value var)))) - (def: .public (follow! target) + (def: .public (changes target) (All (_ a) (-> (Var a) (IO [(Channel a) (Sink a)]))) (do io.monad [.let [[channel sink] (frp.channel [])] diff --git a/stdlib/source/library/lux/control/exception.lux b/stdlib/source/library/lux/control/exception.lux index 3d0be75fd..3d34b95f7 100644 --- a/stdlib/source/library/lux/control/exception.lux +++ b/stdlib/source/library/lux/control/exception.lux @@ -81,8 +81,8 @@ (let [private (is (Parser [(List |type_variable|.Variable) [Text (List |input|.Input)] (Maybe Code)]) ($_ <>.and (<>.else (list) (.tuple (<>.some |type_variable|.parser))) - (<>.either (.form (<>.and .local_symbol |input|.parser)) - (<>.and .local_symbol (<>#in (list)))) + (<>.either (.form (<>.and .local |input|.parser)) + (<>.and .local (<>#in (list)))) (<>.maybe .any) ))] ($_ <>.either @@ -95,7 +95,7 @@ (do meta.monad [current_module meta.current_module_name .let [descriptor ($_ text#composite "{" current_module "." name "}" text.new_line) - g!self (code.local_symbol name)]] + g!self (code.local name)]] (in (list (` (def: (~ export_policy) (~ g!self) (All ((~ g!_) (~+ (list#each |type_variable|.format t_vars))) diff --git a/stdlib/source/library/lux/control/function/inline.lux b/stdlib/source/library/lux/control/function/inline.lux index f932b64e9..80674c8eb 100644 --- a/stdlib/source/library/lux/control/function/inline.lux +++ b/stdlib/source/library/lux/control/function/inline.lux @@ -17,7 +17,7 @@ (def: declaration (Parser [Text (List Code)]) - (.form (<>.and .local_symbol (<>.some .any)))) + (.form (<>.and .local (<>.some .any)))) (def: inline (Parser [Code [Text (List Code)] Code Code]) @@ -37,7 +37,7 @@ .let [inlined (` (("lux in-module" (~ (code.text @)) (.is (~ type) - (.function ((~ (code.local_symbol name)) (~+ parameters)) + (.function ((~ (code.local name)) (~+ parameters)) (~ term)))) (~+ (list#each (function (_ g!parameter) (` ((~' ~) (~ g!parameter)))) @@ -46,5 +46,5 @@ (list#each (function (_ parameter) (list parameter (` (~! .any))))) list#conjoint)]] - (in (list (` ((~! syntax:) (~ privacy) ((~ (code.local_symbol name)) [(~+ g!parameters)]) + (in (list (` ((~! syntax:) (~ privacy) ((~ (code.local name)) [(~+ g!parameters)]) (.# (~! meta.monad) (~' in) (.list (.`' (~ inlined)))))))))) diff --git a/stdlib/source/library/lux/control/function/mutual.lux b/stdlib/source/library/lux/control/function/mutual.lux index 02f5eaabb..16506a4e3 100644 --- a/stdlib/source/library/lux/control/function/mutual.lux +++ b/stdlib/source/library/lux/control/function/mutual.lux @@ -59,7 +59,7 @@ (in (list body)) {.#Item mutual {.#End}} - (.let [g!name (|> mutual (the [#declaration declaration.#name]) code.local_symbol)] + (.let [g!name (|> mutual (the [#declaration declaration.#name]) code.local)] (in (list (` (.let [(~ g!name) (is (~ (the #type mutual)) (function (~ (declaration.format (the #declaration mutual))) (~ (the #body mutual))))] @@ -77,7 +77,7 @@ context_types (list#each (function (_ mutual) (` (-> (~ g!context) (~ (the #type mutual))))) functions) - user_names (list#each (|>> (the [#declaration declaration.#name]) code.local_symbol) + user_names (list#each (|>> (the [#declaration declaration.#name]) code.local) functions)] g!pop (local.push (list#each (function (_ [g!name mutual]) [[here_name (the [#declaration declaration.#name] mutual)] @@ -129,7 +129,7 @@ context_types (list#each (function (_ mutual) (` (-> (~ g!context) (~ (the [#mutual #type] mutual))))) functions) - user_names (list#each (|>> (the [#mutual #declaration declaration.#name]) code.local_symbol) + user_names (list#each (|>> (the [#mutual #declaration declaration.#name]) code.local) functions)] g!pop (local.push (list#each (function (_ [g!name mutual]) [[here_name (the [#mutual #declaration declaration.#name] mutual)] @@ -147,7 +147,7 @@ user_names))]))) g!pop (list#each (function (_ mutual) - (.let [g!name (|> mutual (the [#mutual #declaration declaration.#name]) code.local_symbol)] + (.let [g!name (|> mutual (the [#mutual #declaration declaration.#name]) code.local)] (` (.def: (~ (the #export_policy mutual)) (~ g!name) diff --git a/stdlib/source/library/lux/control/maybe.lux b/stdlib/source/library/lux/control/maybe.lux index 98192ffa1..4f678aecb 100644 --- a/stdlib/source/library/lux/control/maybe.lux +++ b/stdlib/source/library/lux/control/maybe.lux @@ -148,11 +148,11 @@ (All (_ a) (-> (Maybe a) (List a))) (case value {.#Some value} - {.#Item value {.#End}} + (.list value) ... {.#None} _ - {.#End})) + (.list))) (macro: .public (when tokens state) (case tokens diff --git a/stdlib/source/library/lux/control/parser/analysis.lux b/stdlib/source/library/lux/control/parser/analysis.lux index 2ea814f3d..b6794db76 100644 --- a/stdlib/source/library/lux/control/parser/analysis.lux +++ b/stdlib/source/library/lux/control/parser/analysis.lux @@ -73,7 +73,7 @@ {.#Item [head tail]} {try.#Success [tail head]}))) -(def: .public end! +(def: .public end (Parser Any) (function (_ tokens) (case tokens @@ -111,15 +111,15 @@ _ (exception.except ..cannot_parse input))))))] - [bit bit! /.bit Bit bit.equivalence] - [nat nat! /.nat Nat nat.equivalence] - [int int! /.int Int int.equivalence] - [rev rev! /.rev Rev rev.equivalence] - [frac frac! /.frac Frac frac.equivalence] - [text text! /.text Text text.equivalence] - [local local! /.local Nat nat.equivalence] - [foreign foreign! /.foreign Nat nat.equivalence] - [constant constant! /.constant Symbol symbol.equivalence] + [bit this_bit /.bit Bit bit.equivalence] + [nat this_nat /.nat Nat nat.equivalence] + [int this_int /.int Int int.equivalence] + [rev this_rev /.rev Rev rev.equivalence] + [frac this_frac /.frac Frac frac.equivalence] + [text this_text /.text Text text.equivalence] + [local this_local /.local Nat nat.equivalence] + [foreign this_foreign /.foreign Nat nat.equivalence] + [constant this_constant /.constant Symbol symbol.equivalence] ) (def: .public (tuple parser) diff --git a/stdlib/source/library/lux/control/parser/code.lux b/stdlib/source/library/lux/control/parser/code.lux index 910d7f449..6b76cd137 100644 --- a/stdlib/source/library/lux/control/parser/code.lux +++ b/stdlib/source/library/lux/control/parser/code.lux @@ -1,6 +1,6 @@ (.using [library - [lux {"-" nat int rev local not symbol} + [lux {"-" nat int rev local not symbol local global} [abstract ["[0]" monad {"+" do}]] [control @@ -81,16 +81,16 @@ _ ))))] - [bit bit! Bit .#Bit bit.equivalence "bit"] - [nat nat! Nat .#Nat nat.equivalence "nat"] - [int int! Int .#Int int.equivalence "int"] - [rev rev! Rev .#Rev rev.equivalence "rev"] - [frac frac! Frac .#Frac frac.equivalence "frac"] - [text text! Text .#Text text.equivalence "text"] - [symbol symbol! Symbol .#Symbol symbol.equivalence "symbol"] + [bit this_bit Bit .#Bit bit.equivalence "bit"] + [nat this_nat Nat .#Nat nat.equivalence "nat"] + [int this_int Int .#Int int.equivalence "int"] + [rev this_rev Rev .#Rev rev.equivalence "rev"] + [frac this_frac Frac .#Frac frac.equivalence "frac"] + [text this_text Text .#Text text.equivalence "text"] + [symbol this_symbol Symbol .#Symbol symbol.equivalence "symbol"] ) -(def: .public (this! code) +(def: .public (this code) (-> Code (Parser Any)) (function (_ tokens) (case tokens @@ -104,7 +104,7 @@ {try.#Failure "There are no tokens to parse!"}))) (with_expansions [ (as_is {try.#Failure ($_ text#composite "Cannot parse local symbol" (remaining_inputs tokens))})] - (def: .public local_symbol + (def: .public local (Parser Text) (function (_ tokens) (case tokens @@ -114,7 +114,7 @@ _ ))) - (def: .public (local_symbol! expected) + (def: .public (this_local expected) (-> Text (Parser Any)) (function (_ tokens) (case tokens @@ -127,7 +127,7 @@ )))) (with_expansions [ (as_is {try.#Failure ($_ text#composite "Cannot parse local symbol" (remaining_inputs tokens))})] - (def: .public global_symbol + (def: .public global (Parser Symbol) (function (_ tokens) (case tokens @@ -140,7 +140,7 @@ _ ))) - (def: .public (global_symbol! expected) + (def: .public (this_global expected) (-> Symbol (Parser Any)) (function (_ tokens) (case tokens @@ -174,7 +174,7 @@ [tuple .#Tuple "tuple"] ) -(def: .public end! +(def: .public end (Parser Any) (function (_ tokens) (case tokens @@ -205,7 +205,7 @@ (text.interposed ", ") (text#composite "Unconsumed inputs: "))}))) -(def: .public (local inputs parser) +(def: .public (locally inputs parser) (All (_ a) (-> (List Code) (Parser a) (Parser a))) (function (_ real) (do try.monad diff --git a/stdlib/source/library/lux/control/parser/json.lux b/stdlib/source/library/lux/control/parser/json.lux index c146ec5d3..130c04815 100644 --- a/stdlib/source/library/lux/control/parser/json.lux +++ b/stdlib/source/library/lux/control/parser/json.lux @@ -108,9 +108,9 @@ _ (//.failure (exception.error ..unexpected_value [head])))))] - [boolean? boolean! /.Boolean bit.equivalence /.#Boolean] - [number? number! /.Number frac.equivalence /.#Number] - [string? string! /.String text.equivalence /.#String] + [boolean? this_boolean /.Boolean bit.equivalence /.#Boolean] + [number? this_number /.Number frac.equivalence /.#Number] + [string? this_string /.String text.equivalence /.#String] ) (def: .public (nullable parser) diff --git a/stdlib/source/library/lux/control/parser/synthesis.lux b/stdlib/source/library/lux/control/parser/synthesis.lux index 6f59a9680..e45f311da 100644 --- a/stdlib/source/library/lux/control/parser/synthesis.lux +++ b/stdlib/source/library/lux/control/parser/synthesis.lux @@ -73,7 +73,7 @@ {.#Item [head tail]} {try.#Success [tail head]}))) -(def: .public end! +(def: .public end (Parser Any) (.function (_ tokens) (case tokens @@ -110,13 +110,13 @@ _ (exception.except ..cannot_parse input)))))] - [bit bit! /.bit Bit bit.equivalence] - [i64 i64! /.i64 I64 i64.equivalence] - [f64 f64! /.f64 Frac frac.equivalence] - [text text! /.text Text text.equivalence] - [local local! /.variable/local Nat n.equivalence] - [foreign foreign! /.variable/foreign Nat n.equivalence] - [constant constant! /.constant Symbol symbol.equivalence] + [bit this_bit /.bit Bit bit.equivalence] + [i64 this_i64 /.i64 I64 i64.equivalence] + [f64 this_f64 /.f64 Frac frac.equivalence] + [text this_text /.text Text text.equivalence] + [local this_local /.variable/local Nat n.equivalence] + [foreign this_foreign /.variable/foreign Nat n.equivalence] + [constant this_constant /.constant Symbol symbol.equivalence] ) (def: .public (tuple parser) diff --git a/stdlib/source/library/lux/control/parser/text.lux b/stdlib/source/library/lux/control/parser/text.lux index 239ddf3bc..1e380a218 100644 --- a/stdlib/source/library/lux/control/parser/text.lux +++ b/stdlib/source/library/lux/control/parser/text.lux @@ -24,10 +24,13 @@ (type: .public Offset Nat) -(def: start_offset +(def: beginning Offset 0) +(exception: .public cannot_parse) +(exception: .public cannot_slice) + (type: .public Parser (//.Parser [Offset Text])) @@ -36,6 +39,18 @@ [#basis Offset #distance Offset])) +(def: .public (slice parser) + (-> (Parser Slice) (Parser Text)) + (do //.monad + [[basis distance] parser] + (function (_ (^.let input [offset tape])) + (case (/.clip basis distance tape) + {.#Some output} + {try.#Success [input output]} + + {.#None} + (exception.except ..cannot_slice []))))) + (def: (left_over offset tape) (-> Offset Text Text) (|> tape (/.clip_since offset) maybe.trusted)) @@ -53,12 +68,9 @@ "Offset" (n#encoded offset) "Input" (..left_over offset tape))) -(exception: .public cannot_parse) -(exception: .public cannot_slice) - (def: .public (result parser input) (All (_ a) (-> (Parser a) Text (Try a))) - (case (parser [start_offset input]) + (case (parser [..beginning input]) {try.#Failure msg} {try.#Failure msg} @@ -138,7 +150,7 @@ _ (exception.except ..cannot_match [reference])))) -(def: .public end! +(def: .public end (Parser Any) (function (_ (^.let input [offset tape])) (if (n.= offset (/.size tape)) @@ -170,31 +182,51 @@ (n.<= top char')))] (in char))) -(template [ ] - [(def: .public - (Parser Text) - (..range (char ) (char )))] +(def: .public (range! bottom top) + (-> Nat Nat (Parser Slice)) + (do //.monad + [it ..any! + char (..slice (in it)) + .let [char' (maybe.trusted (/.char 0 char))] + _ (//.assertion ($_ /#composite "Character is not within range: " (/.of_char bottom) "-" (/.of_char top)) + (.and (n.>= bottom char') + (n.<= top char')))] + (in it))) - [upper "A" "Z" "uppercase"] - [lower "a" "z" "lowercase"] - [decimal "0" "9" "decimal"] - [octal "0" "7" "octal"] +(template [ ] + [(def: .public + (Parser Text) + (..range (char ) (char ))) + + (def: .public + (Parser Slice) + (..range! (char ) (char )))] + + ["A" "Z" upper upper!] + ["a" "z" lower lower!] + ["0" "9" decimal decimal!] + ["0" "7" octal octal!] ) -(def: .public alpha - (Parser Text) - (//.either lower upper)) +(def: .public alpha (Parser Text) (//.either ..lower ..upper)) +(def: .public alpha! (Parser Slice) (//.either ..lower! ..upper!)) -(def: .public alpha_num - (Parser Text) - (//.either alpha decimal)) +(def: .public alpha_num (Parser Text) (//.either ..alpha ..decimal)) +(def: .public alpha_num! (Parser Slice) (//.either ..alpha! ..decimal!)) (def: .public hexadecimal (Parser Text) ($_ //.either - decimal - (range (char "a") (char "f")) - (range (char "A") (char "F")))) + ..decimal + (..range (char "a") (char "f")) + (..range (char "A") (char "F")))) + +(def: .public hexadecimal! + (Parser Slice) + ($_ //.either + ..decimal! + (..range! (char "a") (char "f")) + (..range! (char "A") (char "F")))) (template [] [(exception: .public ( [options Text @@ -261,10 +293,27 @@ _ (exception.except ..cannot_parse [])))) +(def: .public (satisfies! parser) + (-> (-> Char Bit) (Parser Slice)) + (function (_ [offset tape]) + (case (/.char offset tape) + {.#Some output} + (if (parser output) + {try.#Success [[("lux i64 +" 1 offset) tape] + [#basis offset #distance 1]]} + (exception.except ..character_does_not_satisfy_predicate [output])) + + _ + (exception.except ..cannot_parse [])))) + (def: .public space (Parser Text) (..satisfies /.space?)) +(def: .public space! + (Parser Slice) + (..satisfies! /.space?)) + (def: .public (and left right) (-> (Parser Text) (Parser Text) (Parser Text)) (do //.monad @@ -275,9 +324,9 @@ (def: .public (and! left right) (-> (Parser Slice) (Parser Slice) (Parser Slice)) (do //.monad - [[left::basis left::distance] left - [right::basis right::distance] right] - (in [left::basis ("lux i64 +" left::distance right::distance)]))) + [(open "left[0]") left + (open "right[0]") right] + (in [left#basis ("lux i64 +" left#distance right#distance)]))) (template [ ] [(def: .public ( parser) @@ -347,18 +396,6 @@ {try.#Success value} {try.#Success [real_input value]}))) -(def: .public (slice parser) - (-> (Parser Slice) (Parser Text)) - (do //.monad - [[basis distance] parser] - (function (_ (^.let input [offset tape])) - (case (/.clip basis distance tape) - {.#Some output} - {try.#Success [input output]} - - {.#None} - (exception.except ..cannot_slice []))))) - (def: .public (then structured text) (All (_ s a) (-> (Parser a) diff --git a/stdlib/source/library/lux/control/parser/type.lux b/stdlib/source/library/lux/control/parser/type.lux index 3e772e237..d13f44b21 100644 --- a/stdlib/source/library/lux/control/parser/type.lux +++ b/stdlib/source/library/lux/control/parser/type.lux @@ -137,7 +137,7 @@ (def: (label idx) (-> Nat Code) - (code.local_symbol ($_ text#composite "label" text.tab (n#encoded idx)))) + (code.local ($_ text#composite "label" text.tab (n#encoded idx)))) (def: .public (with_extension type poly) (All (_ a) (-> Type (Parser a) (Parser [Code a]))) @@ -270,7 +270,7 @@ _ (//.failure (exception.error ..not_parameter headT))))) -(def: .public (parameter! id) +(def: .public (this_parameter id) (-> Nat (Parser Any)) (do //.monad [env ..env @@ -341,7 +341,7 @@ (do [! //.monad] [env ..env [funcT argsT] (..applied (//.and any (//.many any))) - _ (local (list funcT) (..parameter! 0)) + _ (local (list funcT) (..this_parameter 0)) allC (let [allT (list& funcT argsT)] (|> allT (monad.each ! (function.constant ..parameter)) diff --git a/stdlib/source/library/lux/control/security/capability.lux b/stdlib/source/library/lux/control/security/capability.lux index b23ddf2e6..322f2cf5b 100644 --- a/stdlib/source/library/lux/control/security/capability.lux +++ b/stdlib/source/library/lux/control/security/capability.lux @@ -43,7 +43,7 @@ (|export|.parser ($_ <>.and |declaration|.parser - (.form ($_ <>.and .local_symbol .any .any))))]) + (.form ($_ <>.and .local .any .any))))]) (macro.with_symbols [g!_] (do [! meta.monad] [this_module meta.current_module_name @@ -54,8 +54,8 @@ (in (list (` (type: (~ export_policy) (~ (|declaration|.format declaration)) (~ capability))) - (` (def: (~ (code.local_symbol forger)) - (All ((~ g!_) (~+ (list#each code.local_symbol vars))) + (` (def: (~ (code.local forger)) + (All ((~ g!_) (~+ (list#each code.local vars))) (-> (-> (~ input) (~ output)) (~ capability))) (~! ..capability))) diff --git a/stdlib/source/library/lux/data/format/css/property.lux b/stdlib/source/library/lux/data/format/css/property.lux index 65b4bfd5f..944701b7a 100644 --- a/stdlib/source/library/lux/data/format/css/property.lux +++ b/stdlib/source/library/lux/data/format/css/property.lux @@ -55,7 +55,7 @@ Z_Index}]]) (syntax: (text_symbol [symbol s.text]) - (in (list (code.local_symbol (text.replaced "-" "_" symbol))))) + (in (list (code.local (text.replaced "-" "_" symbol))))) (abstract: .public (Property brand) Text diff --git a/stdlib/source/library/lux/data/format/css/query.lux b/stdlib/source/library/lux/data/format/css/query.lux index 7e2272c4a..afcd0740b 100644 --- a/stdlib/source/library/lux/data/format/css/query.lux +++ b/stdlib/source/library/lux/data/format/css/query.lux @@ -22,7 +22,7 @@ Light Scripting Motion Color_Scheme}]]) (syntax: (text_symbol [symbol s.text]) - (in (list (code.local_symbol (text.replaced "-" "_" symbol))))) + (in (list (code.local (text.replaced "-" "_" symbol))))) (abstract: .public Media Text diff --git a/stdlib/source/library/lux/data/format/css/value.lux b/stdlib/source/library/lux/data/format/css/value.lux index dad95e9b8..8318ffe71 100644 --- a/stdlib/source/library/lux/data/format/css/value.lux +++ b/stdlib/source/library/lux/data/format/css/value.lux @@ -30,7 +30,7 @@ [selector {"+" Label}]]) (syntax: (text_symbol [symbol .text]) - (in (list (code.local_symbol (text.replaced "-" "_" symbol))))) + (in (list (code.local (text.replaced "-" "_" symbol))))) (template: (enumeration: + +) [(abstract: .public diff --git a/stdlib/source/library/lux/data/format/xml.lux b/stdlib/source/library/lux/data/format/xml.lux index 2459936a2..b7e3fd2e3 100644 --- a/stdlib/source/library/lux/data/format/xml.lux +++ b/stdlib/source/library/lux/data/format/xml.lux @@ -8,7 +8,7 @@ [control [try {"+" Try}] ["<>" parser ("[1]#[0]" monad) - ["<[0]>" text {"+" Parser}]]] + ["<[0]>" text {"+" Parser Slice}]]] [data ["[0]" product] ["[0]" text {"+" \n} ("[1]#[0]" equivalence monoid)] @@ -56,15 +56,18 @@ (def: xml_unicode_escape_char^ (Parser Text) - (|> (do <>.monad - [hex? (<>.maybe (.this "x")) - code (case hex? - {.#None} - (<>.codec int.decimal (.many .decimal)) - - {.#Some _} - (<>.codec int.decimal (.many .hexadecimal)))] - (in (|> code .nat text.of_char))) + (|> (do [! <>.monad] + [hex? (<>.maybe (.this "x"))] + (<| (# ! each (|>> .nat text.of_char)) + (<>.codec int.decimal) + .slice + .many! + (case hex? + {.#None} + .decimal! + + {.#Some _} + .hexadecimal!))) (<>.before (.this ";")) (<>.after (.this "&#")))) @@ -80,12 +83,12 @@ (def: xml_identifier (Parser Text) - (do <>.monad - [head (<>.either (.one_of "_") - .alpha) - tail (.some (<>.either (.one_of "_.-") - .alpha_num))] - (in ($_ text#composite head tail)))) + (.slice + ($_ .and! + (<>.either (.one_of! "_") + .alpha!) + (.some! (<>.either (.one_of! "_.-") + .alpha_num!))))) (def: namespaced_symbol^ (Parser Symbol) @@ -135,9 +138,9 @@ (symbol#= expected actual)))) (def: comment^ - (Parser Text) - (|> (.not (.this "--")) - .some + (Parser Slice) + (|> (.not! (.this "--")) + .some! (.enclosed [""]) ..spaced^)) @@ -149,9 +152,9 @@ ..spaced^)) (def: cdata^ - (Parser Text) + (Parser Slice) (let [end (.this "]]>")] - (|> (.some (.not end)) + (|> (.some! (.not! end)) (<>.after end) (<>.after (.this " (..spaced^ (.many xml_char^)) - (<>.either cdata^) + (<>.either (.slice cdata^)) (<>#each (|>> {#Text})))) (def: null^ @@ -180,7 +183,7 @@ (in {#Node tag attrs (list)})) (do <>.monad [_ (.this ">") - _ (<>.some (<>.either .space + _ (<>.some (<>.either .space! ..comment^)) _ (..close_tag^ tag)] (in {#Node tag attrs (list)}))) diff --git a/stdlib/source/library/lux/debug.lux b/stdlib/source/library/lux/debug.lux index 987a25120..79a8b16e1 100644 --- a/stdlib/source/library/lux/debug.lux +++ b/stdlib/source/library/lux/debug.lux @@ -549,9 +549,9 @@ (def: target (.Parser Target) - (<>.either (<>.and .local_symbol + (<>.either (<>.and .local (# <>.monad in {.#None})) - (.tuple (<>.and .local_symbol + (.tuple (<>.and .local (# <>.monad each (|>> {.#Some}) .any))))) (exception: .public (unknown_local_binding [name Text]) @@ -597,5 +597,5 @@ {.#Some format} format)] (list (code.text name) - (` ((~ format) (~ (code.local_symbol name)))))))) + (` ((~ format) (~ (code.local name)))))))) list#conjoint)))))))))) diff --git a/stdlib/source/library/lux/documentation.lux b/stdlib/source/library/lux/documentation.lux index 3d4cdcced..8a78ca8e6 100644 --- a/stdlib/source/library/lux/documentation.lux +++ b/stdlib/source/library/lux/documentation.lux @@ -447,7 +447,7 @@ (def: description (Parser (Maybe Code)) - (<>.or (.text! "") + (<>.or (.this_text "") .any)) (exception: .public (unqualified_symbol [name Symbol]) @@ -496,7 +496,7 @@ (Parser Declaration) (<>.either (<>.and ..qualified_symbol (<>#in (list))) (.form (<>.and ..qualified_symbol - (<>.some (.local_symbol)))))) + (<>.some (.local)))))) (syntax: (minimal_definition_documentation [[name parameters] ..declaration]) @@ -509,13 +509,13 @@ (in (list (` ($_ ((~! md.then)) ... Name (<| ((~! md.heading/3)) - (~ (code.text (%.code (let [g!name (|> name product.right code.local_symbol)] + (~ (code.text (%.code (let [g!name (|> name product.right code.local)] (case parameters {.#End} g!name _ - (` ((~ g!name) (~+ (list#each code.local_symbol parameters)))))))))) + (` ((~ g!name) (~+ (list#each code.local parameters)))))))))) ... Type (let [(~ g!type) ("lux in-module" (~ g!module) @@ -545,7 +545,7 @@ (in (list (` ($_ ((~! md.then)) ((~! ..minimal_definition_documentation) ((~ (code.symbol name)) - (~+ (list#each code.local_symbol parameters)))) + (~+ (list#each code.local parameters)))) ... Description (~+ (case description {.#Some description} @@ -586,17 +586,17 @@ (list [..#definition (~ (code.text short)) ..#documentation ((~! ..minimal_definition_documentation) ((~ (code.symbol name)) - (~+ (list#each code.local_symbol parameters))))]))))))) + (~+ (list#each code.local parameters))))]))))))) (syntax: .public (documentation: [[name parameters] ..declaration extra (<>.some .any)]) (let [[_ short] name] - (in (list (` (.def: .public (~ (code.local_symbol short)) + (in (list (` (.def: .public (~ (code.local short)) (.List ..Definition) (.list [..#definition (~ (code.text short)) ..#documentation ((~! ..definition_documentation) ((~ (code.symbol name)) - (~+ (list#each code.local_symbol parameters))) + (~+ (list#each code.local parameters))) (~+ extra))]))))))) (def: definitions_documentation diff --git a/stdlib/source/library/lux/extension.lux b/stdlib/source/library/lux/extension.lux index 2e2c74f23..b41d45138 100644 --- a/stdlib/source/library/lux/extension.lux +++ b/stdlib/source/library/lux/extension.lux @@ -31,17 +31,17 @@ (-> Code (Parser Declaration)) (.form ($_ <>.and .any - .local_symbol - .local_symbol - .local_symbol + .local + .local + .local (.tuple (<>.some .any))))) (template [ ] [(syntax: .public ( [[name extension phase archive inputs] (..declaration (` )) body .any]) - (let [g!name (code.local_symbol extension) - g!phase (code.local_symbol phase) - g!archive (code.local_symbol archive)] + (let [g!name (code.local extension) + g!phase (code.local phase) + g!archive (code.local archive)] (with_symbols [g!handler g!inputs g!error g!_] (in (list (` ( (~ name) (.function ((~ g!handler) (~ g!name) (~ g!phase) (~ g!archive) (~ g!inputs)) @@ -58,8 +58,8 @@ ((~! phase.failure) (~ g!error))) ))))))))] - [.any .end! .and .result "lux def analysis" analysis:] - [.any .end! .and .result "lux def synthesis" synthesis:] - [.any .end! .and .result "lux def generation" generation:] - [.any .end! .and .result "lux def directive" directive:] + [.any .end .and .result "lux def analysis" analysis:] + [.any .end .and .result "lux def synthesis" synthesis:] + [.any .end .and .result "lux def generation" generation:] + [.any .end .and .result "lux def directive" directive:] ) diff --git a/stdlib/source/library/lux/ffi.jvm.lux b/stdlib/source/library/lux/ffi.jvm.lux index 446f2e738..67932ee7c 100644 --- a/stdlib/source/library/lux/ffi.jvm.lux +++ b/stdlib/source/library/lux/ffi.jvm.lux @@ -410,27 +410,27 @@ (-> Text Text (Parser Code)) (do <>.monad [.let [dotted_name (format "::" field_name)] - _ (.this! (code.symbol ["" dotted_name]))] + _ (.this (code.symbol ["" dotted_name]))] (in (get_static_field class_name field_name)))) (def: (get_var_parser class_name field_name self_name) (-> Text Text Text (Parser Code)) (do <>.monad [.let [dotted_name (format "::" field_name)] - _ (.this! (code.symbol ["" dotted_name]))] - (in (get_virtual_field class_name field_name (code.local_symbol self_name))))) + _ (.this (code.symbol ["" dotted_name]))] + (in (get_virtual_field class_name field_name (code.local self_name))))) (def: (put_var_parser class_name field_name self_name) (-> Text Text Text (Parser Code)) (do <>.monad [.let [dotted_name (format "::" field_name)] [_ _ value] (is (Parser [Any Any Code]) - (.form ($_ <>.and (.this! (' :=)) (.this! (code.symbol ["" dotted_name])) .any)))] + (.form ($_ <>.and (.this (' :=)) (.this (code.symbol ["" dotted_name])) .any)))] (in (`' ("jvm member put virtual" (~ (code.text class_name)) (~ (code.text field_name)) (~ value) - (~ (code.local_symbol self_name))))))) + (~ (code.local self_name))))))) (def: (replaced f input) (-> (-> Code Code) Code Code) @@ -473,7 +473,7 @@ (-> Text (List Argument) (Parser Code)) (do <>.monad [args (is (Parser (List Code)) - (.form (<>.after (.this! (' ::new!)) + (.form (<>.after (.this (' ::new!)) (.tuple (<>.exactly (list.size arguments) .any)))))] (in (` ("jvm member invoke constructor" (~ (code.text class_name)) (~+ (|> args @@ -485,7 +485,7 @@ (do <>.monad [.let [dotted_name (format "::" method_name "!")] args (is (Parser (List Code)) - (.form (<>.after (.this! (code.symbol ["" dotted_name])) + (.form (<>.after (.this (code.symbol ["" dotted_name])) (.tuple (<>.exactly (list.size arguments) .any)))))] (in (` ("jvm member invoke static" (~ (code.text class_name)) (~ (code.text method_name)) (~+ (|> args @@ -498,12 +498,12 @@ (do <>.monad [.let [dotted_name (format "::" method_name "!")] args (is (Parser (List Code)) - (.form (<>.after (.this! (code.symbol ["" dotted_name])) + (.form (<>.after (.this (code.symbol ["" dotted_name])) (.tuple (<>.exactly (list.size arguments) .any)))))] (in (` ( [(~+ (list#each (|>> ..signature code.text) class_vars))] (~ (code.text class_name)) (~ (code.text method_name)) [(~+ (list#each (|>> ..signature code.text) type_vars))] - (~ (code.local_symbol self_name)) + (~ (code.local self_name)) (~+ (|> args (list.zipped/2 (list#each product.right arguments)) (list#each ..decorate_input))))))))] @@ -537,17 +537,17 @@ (Parser Privacy) (let [(open "[0]") <>.monad] ($_ <>.or - (.this! (' "public")) - (.this! (' "private")) - (.this! (' "protected")) + (.this (' "public")) + (.this (' "private")) + (.this (' "protected")) (in [])))) (def: inheritance_modifier^ (Parser Inheritance) (let [(open "[0]") <>.monad] ($_ <>.or - (.this! (' "final")) - (.this! (' "abstract")) + (.this (' "final")) + (.this (' "abstract")) (in [])))) (exception: .public (class_names_cannot_contain_periods [name Text]) @@ -568,7 +568,7 @@ (def: (valid_class_name type_vars) (-> (List (Type Var)) (Parser External)) (do <>.monad - [name .local_symbol + [name .local _ (..assertion ..class_names_cannot_contain_periods [name] (not (text.contains? name.external_separator name))) _ (..assertion ..class_name_cannot_be_a_type_variable [name type_vars] @@ -597,7 +597,7 @@ (def: (type_variable options) (-> (List (Type Var)) (Parser (Type Parameter))) (do <>.monad - [name .local_symbol + [name .local _ (..assertion ..unknown_type_variable [name options] (list.member? text.equivalence (list#each parser.name options) name))] (in (jvm.var name)))) @@ -605,13 +605,13 @@ (def: wildcard^ (Parser (Type Parameter)) (do <>.monad - [_ (.this! (' ?))] + [_ (.this (' ?))] (in jvm.wildcard))) (template [ ] [(def: (-> (Parser (Type Class)) (Parser (Type Parameter))) - (|>> (<>.after (.this! (' ))) + (|>> (<>.after (.this (' ))) (<>.after ..wildcard^) .tuple (# <>.monad each )))] @@ -638,7 +638,7 @@ (-> (Type (<| Return' Value' category)) (Parser (Type (<| Return' Value' category))))) (do <>.monad - [_ (.symbol! ["" (..reflection type)])] + [_ (.this_symbol ["" (..reflection type)])] (in type))) (def: primitive^ @@ -672,7 +672,7 @@ (def: void^ (Parser (Type Void)) (do <>.monad - [_ (.symbol! ["" (reflection.reflection reflection.void)])] + [_ (.this_symbol ["" (reflection.reflection reflection.void)])] (in jvm.void))) (def: (return^ type_vars) @@ -682,7 +682,7 @@ (def: var^ (Parser (Type Var)) - (# <>.monad each jvm.var .local_symbol)) + (# <>.monad each jvm.var .local)) (def: vars^ (Parser (List (Type Var))) @@ -710,23 +710,23 @@ (def: annotation^ (Parser Annotation) (<>.either (do <>.monad - [ann_name .local_symbol] + [ann_name .local] (in [ann_name (list)])) - (.form (<>.and .local_symbol + (.form (<>.and .local annotation_parameters^)))) (def: annotations^ (Parser (List Annotation)) (<| (<>.else (list)) (do <>.monad - [_ (.this! (' "ann"))] + [_ (.this (' "ann"))] (.tuple (<>.some ..annotation^))))) (def: (throws_decl^ type_vars) (-> (List (Type Var)) (Parser (List (Type Class)))) (<| (<>.else (list)) (do <>.monad - [_ (.this! (' "throws"))] + [_ (.this (' "throws"))] (.tuple (<>.some (..class^ type_vars)))))) (def: (method_decl^ type_vars) @@ -734,7 +734,7 @@ (.form (do <>.monad [tvars (<>.else (list) ..vars^) .let [total_vars (list#composite tvars type_vars)] - name .local_symbol + name .local anns ..annotations^ inputs (.tuple (<>.some (..type^ total_vars))) output (..return^ total_vars) @@ -747,15 +747,15 @@ (def: state_modifier^ (Parser State) ($_ <>.or - (.this! (' "volatile")) - (.this! (' "final")) + (.this (' "volatile")) + (.this (' "final")) (# <>.monad in []))) (def: (field_decl^ type_vars) (-> (List (Type Var)) (Parser [Member_Declaration FieldDecl])) (<>.either (.form (do <>.monad - [_ (.this! (' "const")) - name .local_symbol + [_ (.this (' "const")) + name .local anns ..annotations^ type (..type^ type_vars) body .any] @@ -763,15 +763,15 @@ (.form (do <>.monad [pm privacy_modifier^ sm state_modifier^ - static? (<>.parses? (.this! (' "static"))) - name .local_symbol + static? (<>.parses? (.this (' "static"))) + name .local anns ..annotations^ type (..type^ type_vars)] (in [[name pm anns] {#VariableField [sm static? type]}]))))) (def: (argument^ type_vars) (-> (List (Type Var)) (Parser Argument)) - (<>.and .local_symbol + (<>.and .local (..type^ type_vars))) (def: (arguments^ type_vars) @@ -790,12 +790,12 @@ (-> (List (Type Var)) (Parser [Member_Declaration Method_Definition])) (.form (do <>.monad [pm privacy_modifier^ - strict_fp? (<>.parses? (.text! "strict")) + strict_fp? (<>.parses? (.this_text "strict")) method_vars (<>.else (list) ..vars^) .let [total_vars (list#composite class_vars method_vars)] [_ self_name arguments] (.form ($_ <>.and - (.this! (' new)) - .local_symbol + (.this (' new)) + .local (..arguments^ total_vars))) constructor_args (..constructor_args^ total_vars) exs (throws_decl^ total_vars) @@ -810,13 +810,13 @@ (-> (List (Type Var)) (Parser [Member_Declaration Method_Definition])) (.form (do <>.monad [pm privacy_modifier^ - strict_fp? (<>.parses? (.this! (' "strict"))) - final? (<>.parses? (.this! (' "final"))) + strict_fp? (<>.parses? (.this (' "strict"))) + final? (<>.parses? (.this (' "final"))) method_vars (<>.else (list) ..vars^) .let [total_vars (list#composite class_vars method_vars)] [name self_name arguments] (.form ($_ <>.and - .local_symbol - .local_symbol + .local + .local (..arguments^ total_vars))) return_type (..return^ total_vars) exs (throws_decl^ total_vars) @@ -830,14 +830,14 @@ (def: overriden_method_def^ (Parser [Member_Declaration Method_Definition]) (.form (do <>.monad - [strict_fp? (<>.parses? (.this! (' "strict"))) + [strict_fp? (<>.parses? (.this (' "strict"))) owner_class ..declaration^ method_vars (<>.else (list) ..vars^) .let [total_vars (list#composite (product.right (parser.declaration owner_class)) method_vars)] [name self_name arguments] (.form ($_ <>.and - .local_symbol - .local_symbol + .local + .local (..arguments^ total_vars))) return_type (..return^ total_vars) exs (throws_decl^ total_vars) @@ -852,11 +852,11 @@ (Parser [Member_Declaration Method_Definition]) (.form (do <>.monad [pm privacy_modifier^ - strict_fp? (<>.parses? (.this! (' "strict"))) - _ (.this! (' "static")) + strict_fp? (<>.parses? (.this (' "strict"))) + _ (.this (' "static")) method_vars (<>.else (list) ..vars^) .let [total_vars method_vars] - [name arguments] (.form (<>.and .local_symbol + [name arguments] (.form (<>.and .local (..arguments^ total_vars))) return_type (..return^ total_vars) exs (throws_decl^ total_vars) @@ -871,10 +871,10 @@ (Parser [Member_Declaration Method_Definition]) (.form (do <>.monad [pm privacy_modifier^ - _ (.this! (' "abstract")) + _ (.this (' "abstract")) method_vars (<>.else (list) ..vars^) .let [total_vars method_vars] - [name arguments] (.form (<>.and .local_symbol + [name arguments] (.form (<>.and .local (..arguments^ total_vars))) return_type (..return^ total_vars) exs (throws_decl^ total_vars) @@ -888,10 +888,10 @@ (Parser [Member_Declaration Method_Definition]) (.form (do <>.monad [pm privacy_modifier^ - _ (.this! (' "native")) + _ (.this (' "native")) method_vars (<>.else (list) ..vars^) .let [total_vars method_vars] - [name arguments] (.form (<>.and .local_symbol + [name arguments] (.form (<>.and .local (..arguments^ total_vars))) return_type (..return^ total_vars) exs (throws_decl^ total_vars) @@ -918,36 +918,36 @@ (def: import_member_alias^ (Parser (Maybe Text)) (<>.maybe (do <>.monad - [_ (.this! (' "as"))] - .local_symbol))) + [_ (.this (' "as"))] + .local))) (def: (import_member_args^ type_vars) (-> (List (Type Var)) (Parser (List [Bit (Type Value)]))) - (.tuple (<>.some (<>.and (<>.parses? (.this! (' "?"))) + (.tuple (<>.some (<>.and (<>.parses? (.this (' "?"))) (..type^ type_vars))))) (def: import_member_return_flags^ (Parser [Bit Bit Bit]) ($_ <>.and - (<>.parses? (.this! (' "io"))) - (<>.parses? (.this! (' "try"))) - (<>.parses? (.this! (' "?"))))) + (<>.parses? (.this (' "io"))) + (<>.parses? (.this (' "try"))) + (<>.parses? (.this (' "?"))))) (def: primitive_mode^ (Parser Primitive_Mode) - (<>.or (.this! (' "manual")) - (.this! (' "auto")))) + (<>.or (.this (' "manual")) + (.this (' "auto")))) (def: (import_member_decl^ owner_vars) (-> (List (Type Var)) (Parser Import_Member_Declaration)) ($_ <>.either (.form (do <>.monad - [_ (.this! (' "enum")) - enum_members (<>.some .local_symbol)] + [_ (.this (' "enum")) + enum_members (<>.some .local)] (in {#EnumDecl enum_members}))) (.form (do <>.monad [tvars (<>.else (list) ..vars^) - _ (.symbol! ["" "new"]) + _ (.this_symbol ["" "new"]) ?alias import_member_alias^ .let [total_vars (list#composite owner_vars tvars)] ?prim_mode (<>.maybe primitive_mode^) @@ -965,10 +965,10 @@ )) (.form (do <>.monad [kind (is (Parser ImportMethodKind) - (<>.or (.this! (' "static")) + (<>.or (.this (' "static")) (in []))) tvars (<>.else (list) ..vars^) - name .local_symbol + name .local ?alias import_member_alias^ .let [total_vars (list#composite owner_vars tvars)] ?prim_mode (<>.maybe primitive_mode^) @@ -986,12 +986,12 @@ [#import_method_name name #import_method_return return]]}))) (.form (do <>.monad - [static? (<>.parses? (.this! (' "static"))) - name .local_symbol + [static? (<>.parses? (.this (' "static"))) + name .local ?prim_mode (<>.maybe primitive_mode^) gtype (..type^ owner_vars) - maybe? (<>.parses? (.this! (' "?"))) - setter? (<>.parses? (.this! (' #!)))] + maybe? (<>.parses? (.this (' "?"))) + setter? (<>.parses? (.this (' #!)))] (in {#FieldAccessDecl [#import_field_mode (maybe.else {#AutoPrM} ?prim_mode) #import_field_name name #import_field_static? static? @@ -1038,7 +1038,7 @@ (def: var$' (-> (Type Var) Code) - (|>> ..signature code.local_symbol)) + (|>> ..signature code.local)) (def: (method_decl$ [[name pm anns] method_decl]) (-> [Member_Declaration MethodDecl] Code) @@ -1128,14 +1128,14 @@ (list#mix <>.either method_parser) parser->replacer) super_replacer (parser->replacer (.form (do <>.monad - [_ (.this! (' ::super!)) + [_ (.this (' ::super!)) args (.tuple (<>.exactly (list.size arguments) .any))] (in (` ("jvm member invoke special" [(~+ (list#each (|>> ..signature code.text) (product.right (parser.declaration declaration))))] (~ (code.text (product.left (parser.read_class super_class)))) (~ (code.text name)) [(~+ (list#each (|>> ..signature code.text) type_vars))] - ("jvm object cast" (~ (code.local_symbol self_name))) + ("jvm object cast" (~ (code.local self_name))) (~+ (|> args (list#each (|>> ~ "jvm object cast" `)) (list.zipped/2 (list#each product.right arguments)) diff --git a/stdlib/source/library/lux/ffi.lux b/stdlib/source/library/lux/ffi.lux index 6554a4082..8a9c74362 100644 --- a/stdlib/source/library/lux/ffi.lux +++ b/stdlib/source/library/lux/ffi.lux @@ -1,6 +1,6 @@ (.using [library - [lux {"-" Symbol Alias Global global function} + [lux {"-" Symbol Alias Global global function type_of} ["@" target] ["[0]" meta] [abstract @@ -21,7 +21,7 @@ ["[0]" code] ["[0]" template]] [type - abstract]]]) + [abstract {"-" pattern}]]]]) (with_expansions [ (for @.js "js constant" @.python "python constant" @@ -96,7 +96,7 @@ (def: alias (Parser Alias) - (<>.maybe (<>.after (.this! (' "as")) .local_symbol))) + (<>.maybe (<>.after (.this (' "as")) .local))) (type: Optional (Record @@ -106,8 +106,8 @@ (def: optional (Parser Optional) (let [token "?"] - (<| (<>.and (<>.parses? (.text! token))) - (<>.after (<>.not (.text! token))) + (<| (<>.and (<>.parses? (.this_text token))) + (<>.after (<>.not (.this_text token))) .any))) (type: (Named a) @@ -124,7 +124,7 @@ ..alias )))] - [named .local_symbol] + [named .local] [anonymous (<>#in "")] ) @@ -140,7 +140,7 @@ (def: variables (Parser (List Text)) - (<>.else (list) (.tuple (<>.some .local_symbol)))) + (<>.else (list) (.tuple (<>.some .local)))) (def: (generalized $ it) (All (_ a) @@ -163,8 +163,8 @@ ($_ <>.and (<>#in (list)) (.tuple (<>.some ..optional)) - (<>.parses? (.text! "io")) - (<>.parses? (.text! "try")))) + (<>.parses? (.this_text "io")) + (<>.parses? (.this_text "try")))) (type: Constructor (Named Input)) @@ -173,7 +173,7 @@ (Parser Constructor) (<| .form (..generalized (has [#anonymous #variables])) - (<>.after (.this! (' new))) + (<>.after (.this (' new))) (..anonymous ..input))) (type: (Member a) @@ -183,7 +183,7 @@ (def: static! (Parser Any) - (.text! "static")) + (.this_text "static")) (def: (member it) (All (_ a) @@ -252,7 +252,7 @@ (|>> list.enumeration (list#each (.function (_ [idx [optional? type]]) [#optional? optional? - #mandatory (|> idx %.nat code.local_symbol)])))) + #mandatory (|> idx %.nat code.local)])))) (def: (output_type it) (-> Optional Code) @@ -320,10 +320,10 @@ (def: class (Parser Class) ($_ <>.and - (<>.either (<>.and .local_symbol + (<>.either (<>.and .local (<>#in (list))) - (.form (<>.and .local_symbol - (<>.some .local_symbol)))) + (.form (<>.and .local + (<>.some .local)))) ..alias .text (<>.some ..sub))) @@ -363,8 +363,8 @@ (-> (List Code) Code (Named Procedure) Code) (let [g!it (|> (the #alias it) (maybe.else (the #name it)) - code.local_symbol) - g!variables (list#each code.local_symbol (the [#anonymous #input #variables] it)) + code.local) + g!variables (list#each code.local (the [#anonymous #input #variables] it)) input (the [#anonymous #input] it) :parameters: (the #parameters input) g!parameters (..parameters :parameters:) @@ -421,7 +421,7 @@ (-> (List Code) Global Code) (let [g!name (|> (the #alias it) (maybe.else (the #name it)) - code.local_symbol) + code.local) :output: (the #anonymous it)] (` (.def: (~ g!name) (~ (..output_type :output:)) @@ -439,13 +439,13 @@ (the #alias) (maybe.else "new") (..namespaced namespace class_name alias) - code.local_symbol) + code.local) input (the #anonymous it) - g!input_variables (list#each code.local_symbol (the #variables input)) + g!input_variables (list#each code.local (the #variables input)) :parameters: (the #parameters input) g!parameters (..parameters :parameters:) - g!class_variables (list#each code.local_symbol class_parameters) - g!class (` ((~ (code.local_symbol (maybe.else class_name alias))) (~+ g!class_variables))) + g!class_variables (list#each code.local class_parameters) + g!class (` ((~ (code.local (maybe.else class_name alias))) (~+ g!class_variables))) :output: [#optional? false #mandatory g!class]] (` (.def: ((~ g!it) (~+ (case g!parameters {.#End} (list g!it) @@ -469,7 +469,7 @@ g!it (|> (the #alias it) (maybe.else field) (..namespaced namespace class_name alias) - code.local_symbol) + code.local) :field: (the #anonymous it)] (` ((~! syntax:) ((~ g!it) []) (.# (~! meta.monad) (~' in) @@ -488,11 +488,11 @@ g!it (|> (the #alias it) (maybe.else name) (..namespaced namespace class_name alias) - code.local_symbol) + code.local) path (%.format (..host_path class_name) "." name) :field: (the #anonymous it) - g!variables (list#each code.local_symbol class_parameters) - g!class (` ((~ (code.local_symbol (maybe.else class_name alias))) (~+ g!variables)))] + g!variables (list#each code.local class_parameters) + g!class (` ((~ (code.local (maybe.else class_name alias))) (~+ g!variables)))] (` (.def: ((~ g!it) (~ g!it)) (.All ((~ g!it) (~+ g!variables)) (.-> (~ g!class) @@ -528,14 +528,14 @@ g!it (|> (the #alias it) (maybe.else method) (..namespaced namespace class_name alias) - code.local_symbol) + code.local) procedure (the #anonymous it) input (the #input procedure) - g!input_variables (list#each code.local_symbol (the #variables input)) + g!input_variables (list#each code.local (the #variables input)) :parameters: (the #parameters input) g!parameters (..parameters :parameters:) - g!class_variables (list#each code.local_symbol class_parameters) - g!class (` ((~ (code.local_symbol (maybe.else class_name alias))) (~+ g!class_variables))) + g!class_variables (list#each code.local class_parameters) + g!class (` ((~ (code.local (maybe.else class_name alias))) (~+ g!class_variables))) :output: (the #output procedure)] (` (.def: ((~ g!it) (~+ (list#each (the #mandatory) g!parameters)) (~ g!it)) (.All ((~ g!it) (~+ g!class_variables) (~+ g!input_variables)) @@ -580,8 +580,8 @@ alias (the #class_alias it) [class_name class_parameters] class namespace (the #namespace it) - g!class_variables (list#each code.local_symbol class_parameters) - declaration (` ((~ (code.local_symbol (maybe.else class_name alias))) + g!class_variables (list#each code.local class_parameters) + declaration (` ((~ (code.local (maybe.else class_name alias))) (~+ g!class_variables)))] (in (list& (` (.type: (~ declaration) (..Object (.Primitive (~ (code.text (..host_path class_name))) @@ -604,7 +604,7 @@ (for @.ruby (as_is) (syntax: .public (function [[self inputs] (.form ($_ <>.and - .local_symbol + .local (.tuple (<>.some (<>.and .any .any))))) type .any term .any]) @@ -614,14 +614,14 @@ .Any)) (.is (.-> [(~+ (list#each product.right inputs))] (~ type))) - (.function ((~ (code.local_symbol self)) [(~+ (list#each product.left inputs))]) + (.function ((~ (code.local self)) [(~+ (list#each product.left inputs))]) (~ term)))))))) (for @.js (as_is (template: .public (type_of object) [("js type-of" object)]) (syntax: .public (global [type .any - [head tail] (.tuple (<>.and .local_symbol (<>.some .local_symbol)))]) + [head tail] (.tuple (<>.and .local (<>.some .local)))]) (with_symbols [g!_] (let [global (` ("js constant" (~ (code.text head))))] (case tail @@ -642,8 +642,8 @@ {.#None} (~ g!_) - (..global (~ type) [(~ (code.local_symbol (%.format head "." next))) - (~+ (list#each code.local_symbol tail))]))))))))))) + (..global (~ type) [(~ (code.local (%.format head "." next))) + (~+ (list#each code.local tail))]))))))))))) (template: (!defined? ) [(.case (..global Any ) diff --git a/stdlib/source/library/lux/ffi.old.lux b/stdlib/source/library/lux/ffi.old.lux index 697177697..f6822f72a 100644 --- a/stdlib/source/library/lux/ffi.old.lux +++ b/stdlib/source/library/lux/ffi.old.lux @@ -443,14 +443,14 @@ (-> Text Text (Parser Code)) (do <>.monad [.let [dotted_name (format "::" field_name)] - _ (.this! (code.symbol ["" dotted_name]))] + _ (.this (code.symbol ["" dotted_name]))] (in (`' ((~ (code.text (format "jvm getstatic" ":" class_name ":" field_name)))))))) (def: (get_var_parser class_name field_name) (-> Text Text (Parser Code)) (do <>.monad [.let [dotted_name (format "::" field_name)] - _ (.this! (code.symbol ["" dotted_name]))] + _ (.this (code.symbol ["" dotted_name]))] (in (`' ((~ (code.text (format "jvm getfield" ":" class_name ":" field_name))) _jvm_this))))) (def: (put_var_parser class_name field_name) @@ -458,7 +458,7 @@ (do <>.monad [.let [dotted_name (format "::" field_name)] [_ _ value] (is (Parser [Any Any Code]) - (.form ($_ <>.and (.this! (' :=)) (.this! (code.symbol ["" dotted_name])) .any)))] + (.form ($_ <>.and (.this (' :=)) (.this (code.symbol ["" dotted_name])) .any)))] (in (`' ((~ (code.text (format "jvm putfield" ":" class_name ":" field_name))) _jvm_this (~ value)))))) (def: (pre_walk_replace f input) @@ -498,7 +498,7 @@ (-> (List Type_Parameter) Text (List ArgDecl) (Parser Code)) (do <>.monad [args (is (Parser (List Code)) - (.form (<>.after (.this! (' ::new!)) + (.form (<>.after (.this (' ::new!)) (.tuple (<>.exactly (list.size arg_decls) .any))))) .let [arg_decls' (is (List Text) (list#each (|>> product.right (simple_class$ params)) arg_decls))]] (in (` ((~ (code.text (format "jvm new" ":" class_name ":" (text.interposed "," arg_decls')))) @@ -509,7 +509,7 @@ (do <>.monad [.let [dotted_name (format "::" method_name "!")] args (is (Parser (List Code)) - (.form (<>.after (.this! (code.symbol ["" dotted_name])) + (.form (<>.after (.this (code.symbol ["" dotted_name])) (.tuple (<>.exactly (list.size arg_decls) .any))))) .let [arg_decls' (is (List Text) (list#each (|>> product.right (simple_class$ params)) arg_decls))]] (in (`' ((~ (code.text (format "jvm invokestatic" ":" class_name ":" method_name ":" (text.interposed "," arg_decls')))) @@ -521,7 +521,7 @@ (do <>.monad [.let [dotted_name (format "::" method_name "!")] args (is (Parser (List Code)) - (.form (<>.after (.this! (code.symbol ["" dotted_name])) + (.form (<>.after (.this (code.symbol ["" dotted_name])) (.tuple (<>.exactly (list.size arg_decls) .any))))) .let [arg_decls' (is (List Text) (list#each (|>> product.right (simple_class$ params)) arg_decls))]] (in (`' ((~ (code.text (format ":" class_name ":" method_name ":" (text.interposed "," arg_decls')))) @@ -555,23 +555,23 @@ (Parser Privacy) (let [(open "[0]") <>.monad] ($_ <>.or - (.this! (' "public")) - (.this! (' "private")) - (.this! (' "protected")) + (.this (' "public")) + (.this (' "private")) + (.this (' "protected")) (in [])))) (def: inheritance_modifier^ (Parser Inheritance) (let [(open "[0]") <>.monad] ($_ <>.or - (.this! (' "final")) - (.this! (' "abstract")) + (.this (' "final")) + (.this (' "abstract")) (in [])))) (def: bound_kind^ (Parser BoundKind) - (<>.or (.this! (' <)) - (.this! (' >)))) + (<>.or (.this (' <)) + (.this (' >)))) (def: (no_periods_assertion name) (-> Text (Parser Any)) @@ -584,15 +584,15 @@ (function (_ again^) ($_ <>.either (do <>.monad - [_ (.this! (' ?))] + [_ (.this (' ?))] (in {#GenericWildcard {.#None}})) (.tuple (do <>.monad - [_ (.this! (' ?)) + [_ (.this (' ?)) bound_kind bound_kind^ bound again^] (in {#GenericWildcard {.#Some [bound_kind bound]}}))) (do <>.monad - [name .local_symbol + [name .local _ (no_periods_assertion name)] (if (list.member? text.equivalence (list#each product.left type_vars) name) (in {#GenericTypeVar name}) @@ -615,7 +615,7 @@ _ (in {#GenericArray component})))) (.form (do <>.monad - [name .local_symbol + [name .local _ (no_periods_assertion name) params (<>.some again^) _ (<>.assertion (format name " cannot be a type-parameter!") @@ -626,11 +626,11 @@ (def: type_param^ (Parser Type_Parameter) (<>.either (do <>.monad - [param_name .local_symbol] + [param_name .local] (in [param_name (list)])) (.tuple (do <>.monad - [param_name .local_symbol - _ (.this! (' <)) + [param_name .local + _ (.this (' <)) bounds (<>.many (..generic_type^ (list)))] (in [param_name bounds]))))) @@ -644,11 +644,11 @@ (def: class_decl^ (Parser Class_Declaration) (<>.either (do <>.monad - [name .local_symbol + [name .local _ (no_periods_assertion name)] (in [name (list)])) (.form (do <>.monad - [name .local_symbol + [name .local _ (no_periods_assertion name) params (<>.some ..type_param^)] (in [name params]))) @@ -657,11 +657,11 @@ (def: (super_class_decl^ type_vars) (-> (List Type_Parameter) (Parser Super_Class_Decl)) (<>.either (do <>.monad - [name .local_symbol + [name .local _ (no_periods_assertion name)] (in [name (list)])) (.form (do <>.monad - [name .local_symbol + [name .local _ (no_periods_assertion name) params (<>.some (..generic_type^ type_vars))] (in [name params]))))) @@ -673,15 +673,15 @@ (def: annotation^ (Parser Annotation) (<>.either (do <>.monad - [ann_name .local_symbol] + [ann_name .local] (in [ann_name (list)])) - (.form (<>.and .local_symbol + (.form (<>.and .local annotation_params^)))) (def: annotations^' (Parser (List Annotation)) (do <>.monad - [_ (.this! (' "ann"))] + [_ (.this (' "ann"))] (.tuple (<>.some ..annotation^)))) (def: annotations^ @@ -693,7 +693,7 @@ (def: (throws_decl'^ type_vars) (-> (List Type_Parameter) (Parser (List GenericType))) (do <>.monad - [_ (.this! (' "throws"))] + [_ (.this (' "throws"))] (.tuple (<>.some (..generic_type^ type_vars))))) (def: (throws_decl^ type_vars) @@ -706,7 +706,7 @@ (-> (List Type_Parameter) (Parser [Member_Declaration MethodDecl])) (.form (do <>.monad [tvars ..type_params^ - name .local_symbol + name .local anns ..annotations^ inputs (.tuple (<>.some (..generic_type^ type_vars))) output (..generic_type^ type_vars) @@ -719,15 +719,15 @@ (def: state_modifier^ (Parser State) ($_ <>.or - (.this! (' "volatile")) - (.this! (' "final")) + (.this (' "volatile")) + (.this (' "final")) (# <>.monad in []))) (def: (field_decl^ type_vars) (-> (List Type_Parameter) (Parser [Member_Declaration FieldDecl])) (<>.either (.form (do <>.monad - [_ (.this! (' "const")) - name .local_symbol + [_ (.this (' "const")) + name .local anns ..annotations^ type (..generic_type^ type_vars) body .any] @@ -735,14 +735,14 @@ (.form (do <>.monad [pm privacy_modifier^ sm state_modifier^ - name .local_symbol + name .local anns ..annotations^ type (..generic_type^ type_vars)] (in [[name pm anns] {#VariableField [sm type]}]))))) (def: (arg_decl^ type_vars) (-> (List Type_Parameter) (Parser ArgDecl)) - (<>.and .local_symbol + (<>.and .local (..generic_type^ type_vars))) (def: (arg_decls^ type_vars) @@ -761,10 +761,10 @@ (-> (List Type_Parameter) (Parser [Member_Declaration Method_Definition])) (.form (do <>.monad [pm privacy_modifier^ - strict_fp? (<>.parses? (.this! (' "strict"))) + strict_fp? (<>.parses? (.this (' "strict"))) method_vars ..type_params^ .let [total_vars (list#composite class_vars method_vars)] - [_ arg_decls] (.form (<>.and (.this! (' new)) + [_ arg_decls] (.form (<>.and (.this (' new)) (..arg_decls^ total_vars))) constructor_args (..constructor_args^ total_vars) exs (..throws_decl^ total_vars) @@ -779,13 +779,13 @@ (-> (List Type_Parameter) (Parser [Member_Declaration Method_Definition])) (.form (do <>.monad [pm privacy_modifier^ - strict_fp? (<>.parses? (.this! (' "strict"))) - final? (<>.parses? (.this! (' "final"))) + strict_fp? (<>.parses? (.this (' "strict"))) + final? (<>.parses? (.this (' "final"))) method_vars ..type_params^ .let [total_vars (list#composite class_vars method_vars)] [name this_name arg_decls] (.form ($_ <>.and - .local_symbol - .local_symbol + .local + .local (..arg_decls^ total_vars))) return_type (..generic_type^ total_vars) exs (..throws_decl^ total_vars) @@ -802,13 +802,13 @@ (def: overriden_method_def^ (Parser [Member_Declaration Method_Definition]) (.form (do <>.monad - [strict_fp? (<>.parses? (.this! (' "strict"))) + [strict_fp? (<>.parses? (.this (' "strict"))) owner_class ..class_decl^ method_vars ..type_params^ .let [total_vars (list#composite (product.right owner_class) method_vars)] [name this_name arg_decls] (.form ($_ <>.and - .local_symbol - .local_symbol + .local + .local (..arg_decls^ total_vars))) return_type (..generic_type^ total_vars) exs (..throws_decl^ total_vars) @@ -826,11 +826,11 @@ (Parser [Member_Declaration Method_Definition]) (.form (do <>.monad [pm privacy_modifier^ - strict_fp? (<>.parses? (.this! (' "strict"))) - _ (.this! (' "static")) + strict_fp? (<>.parses? (.this (' "strict"))) + _ (.this (' "static")) method_vars ..type_params^ .let [total_vars method_vars] - [name arg_decls] (.form (<>.and .local_symbol + [name arg_decls] (.form (<>.and .local (..arg_decls^ total_vars))) return_type (..generic_type^ total_vars) exs (..throws_decl^ total_vars) @@ -845,10 +845,10 @@ (Parser [Member_Declaration Method_Definition]) (.form (do <>.monad [pm privacy_modifier^ - _ (.this! (' "abstract")) + _ (.this (' "abstract")) method_vars ..type_params^ .let [total_vars method_vars] - [name arg_decls] (.form (<>.and .local_symbol + [name arg_decls] (.form (<>.and .local (..arg_decls^ total_vars))) return_type (..generic_type^ total_vars) exs (..throws_decl^ total_vars) @@ -862,10 +862,10 @@ (Parser [Member_Declaration Method_Definition]) (.form (do <>.monad [pm privacy_modifier^ - _ (.this! (' "native")) + _ (.this (' "native")) method_vars ..type_params^ .let [total_vars method_vars] - [name arg_decls] (.form (<>.and .local_symbol + [name arg_decls] (.form (<>.and .local (..arg_decls^ total_vars))) return_type (..generic_type^ total_vars) exs (..throws_decl^ total_vars) @@ -892,32 +892,32 @@ (def: import_member_alias^ (Parser (Maybe Text)) (<>.maybe (do <>.monad - [_ (.this! (' "as"))] - .local_symbol))) + [_ (.this (' "as"))] + .local))) (def: (import_member_args^ type_vars) (-> (List Type_Parameter) (Parser (List [Bit GenericType]))) - (.tuple (<>.some (<>.and (<>.parses? (.this! (' "?"))) (..generic_type^ type_vars))))) + (.tuple (<>.some (<>.and (<>.parses? (.this (' "?"))) (..generic_type^ type_vars))))) (def: import_member_return_flags^ (Parser [Bit Bit Bit]) - ($_ <>.and (<>.parses? (.this! (' "io"))) (<>.parses? (.this! (' "try"))) (<>.parses? (.this! (' "?"))))) + ($_ <>.and (<>.parses? (.this (' "io"))) (<>.parses? (.this (' "try"))) (<>.parses? (.this (' "?"))))) (def: primitive_mode^ (Parser Primitive_Mode) - (<>.or (.this! (' "manual")) - (.this! (' "auto")))) + (<>.or (.this (' "manual")) + (.this (' "auto")))) (def: (import_member_decl^ owner_vars) (-> (List Type_Parameter) (Parser Import_Member_Declaration)) ($_ <>.either (.form (do <>.monad - [_ (.this! (' "enum")) - enum_members (<>.some .local_symbol)] + [_ (.this (' "enum")) + enum_members (<>.some .local)] (in {#EnumDecl enum_members}))) (.form (do <>.monad [tvars ..type_params^ - _ (.this! (' new)) + _ (.this (' new)) ?alias import_member_alias^ .let [total_vars (list#composite owner_vars tvars)] ?prim_mode (<>.maybe primitive_mode^) @@ -934,10 +934,10 @@ []]}))) (.form (do <>.monad [kind (is (Parser ImportMethodKind) - (<>.or (.this! (' "static")) + (<>.or (.this (' "static")) (in []))) tvars ..type_params^ - name .local_symbol + name .local ?alias import_member_alias^ .let [total_vars (list#composite owner_vars tvars)] ?prim_mode (<>.maybe primitive_mode^) @@ -955,12 +955,12 @@ [#import_method_name name #import_method_return return]]}))) (.form (do <>.monad - [static? (<>.parses? (.this! (' "static"))) - name .local_symbol + [static? (<>.parses? (.this (' "static"))) + name .local ?prim_mode (<>.maybe primitive_mode^) gtype (..generic_type^ owner_vars) - maybe? (<>.parses? (.this! (' "?"))) - setter? (<>.parses? (.this! (' "!")))] + maybe? (<>.parses? (.this (' "?"))) + setter? (<>.parses? (.this (' "!")))] (in {#FieldAccessDecl [#import_field_mode (maybe.else {#AutoPrM} ?prim_mode) #import_field_name name #import_field_static? static? @@ -1121,12 +1121,12 @@ (with_brackets (spaced (list#each generic_type$ exs))) (with_brackets (spaced (list#each arg_decl$ arg_decls))) (generic_type$ return_type) - (code.format (pre_walk_replace replacer (` (let [(~ (code.local_symbol this_name)) (~' _jvm_this)] + (code.format (pre_walk_replace replacer (` (let [(~ (code.local this_name)) (~' _jvm_this)] (~ body)))))))) {#OverridenMethod strict_fp? class_decl type_vars this_name arg_decls return_type body exs} (let [super_replacer (parser_replacer (.form (do <>.monad - [_ (.this! (' ::super!)) + [_ (.this (' ::super!)) args (.tuple (<>.exactly (list.size arg_decls) .any)) .let [arg_decls' (is (List Text) (list#each (|>> product.right (simple_class$ (list))) arg_decls))]] @@ -1145,7 +1145,7 @@ (with_brackets (spaced (list#each generic_type$ exs))) (with_brackets (spaced (list#each arg_decl$ arg_decls))) (generic_type$ return_type) - (|> (` (let [(~ (code.local_symbol this_name)) (~' _jvm_this)] + (|> (` (let [(~ (code.local this_name)) (~' _jvm_this)] (~ body))) (pre_walk_replace replacer) (pre_walk_replace super_replacer) @@ -1312,7 +1312,7 @@ (def: (class_import$ [full_name params]) (-> Class_Declaration Code) - (let [params' (list#each (|>> product.left code.local_symbol) params)] + (let [params' (list#each (|>> product.left code.local) params)] (template.with_locals [g!_] (` (def: (~ (code.symbol ["" full_name])) Type diff --git a/stdlib/source/library/lux/ffi.php.lux b/stdlib/source/library/lux/ffi.php.lux index cb2c6a615..2c71beed1 100644 --- a/stdlib/source/library/lux/ffi.php.lux +++ b/stdlib/source/library/lux/ffi.php.lux @@ -51,8 +51,8 @@ (def: nullable (Parser Nullable) (let [token (' "?")] - (<| (<>.and (<>.parses? (.this! token))) - (<>.after (<>.not (.this! token))) + (<| (<>.and (<>.parses? (.this token))) + (<>.after (<>.not (.this token))) .any))) (type: Alias @@ -60,20 +60,20 @@ (def: alias (Parser Alias) - (<>.after (.this! (' "as")) .local_symbol)) + (<>.after (.this (' "as")) .local)) (type: Field [Bit Text (Maybe Alias) Nullable]) (def: static! (Parser Any) - (.this! (' "static"))) + (.this (' "static"))) (def: field (Parser Field) (.form ($_ <>.and (<>.parses? ..static!) - .local_symbol + .local (<>.maybe ..alias) ..nullable))) @@ -81,7 +81,7 @@ (Parser Field) (.form ($_ <>.and (<>#in true) - .local_symbol + .local (<>.maybe ..alias) ..nullable))) @@ -105,11 +105,11 @@ (def: common_method (Parser Common_Method) ($_ <>.and - .local_symbol + .local (<>.maybe ..alias) (.tuple (<>.some ..nullable)) - (<>.parses? (.this! (' "io"))) - (<>.parses? (.this! (' "try"))) + (<>.parses? (.this (' "io"))) + (<>.parses? (.this (' "try"))) ..nullable)) (def: static_method @@ -136,7 +136,7 @@ (-> (List Nullable) (List [Bit Code])) (|>> list.enumeration (list#each (function (_ [idx [nullable? type]]) - [nullable? (|> idx %.nat code.local_symbol)])))) + [nullable? (|> idx %.nat code.local)])))) (def: (nullable_type [nullable? type]) (-> Nullable Code) @@ -177,7 +177,7 @@ (Parser Import) ($_ <>.or ($_ <>.and - .local_symbol + .local (<>.maybe ..alias) (<>.else ["" (list)] (.tuple (<>.and .text @@ -246,8 +246,8 @@ (|> format (text.replaced "[1]" (maybe.else class alias)) (text.replaced "[0]" member_name) - code.local_symbol))) - g!type (code.local_symbol (maybe.else class alias)) + code.local))) + g!type (code.local (maybe.else class alias)) class_import (` ("php constant" (~ (code.text class))))] (in (list& (` (type: (~ g!type) (..Object (Primitive (~ (code.text class)))))) @@ -302,7 +302,7 @@ {#Function [name alias inputsT io? try? outputT]} (let [imported (` ("php constant" (~ (code.text name))))] - (in (list (..make_function (code.local_symbol (maybe.else name alias)) + (in (list (..make_function (code.local (maybe.else name alias)) g!temp imported inputsT @@ -312,7 +312,7 @@ {#Constant [_ name alias fieldT]} (let [imported (` ("php constant" (~ (code.text name))))] - (in (list (` ((~! syntax:) ((~ (code.local_symbol (maybe.else name alias))) []) + (in (list (` ((~! syntax:) ((~ (code.local (maybe.else name alias))) []) (# (~! meta.monad) (~' in) (list (` (.as (~ (nullable_type fieldT)) (~ imported)))))))))) ))) diff --git a/stdlib/source/library/lux/ffi.scm.lux b/stdlib/source/library/lux/ffi.scm.lux index 93fe11d15..7b338dfd4 100644 --- a/stdlib/source/library/lux/ffi.scm.lux +++ b/stdlib/source/library/lux/ffi.scm.lux @@ -51,8 +51,8 @@ (def: nilable (Parser Nilable) (let [token (' "?")] - (<| (<>.and (<>.parses? (.this! token))) - (<>.after (<>.not (.this! token))) + (<| (<>.and (<>.parses? (.this token))) + (<>.after (<>.not (.this token))) .any))) (type: Alias @@ -60,20 +60,20 @@ (def: alias (Parser Alias) - (<>.after (.this! (' "as")) .local_symbol)) + (<>.after (.this (' "as")) .local)) (type: Field [Bit Text (Maybe Alias) Nilable]) (def: static! (Parser Any) - (.this! (' "static"))) + (.this (' "static"))) (def: field (Parser Field) (.form ($_ <>.and (<>.parses? ..static!) - .local_symbol + .local (<>.maybe ..alias) ..nilable))) @@ -81,7 +81,7 @@ (Parser Field) (.form ($_ <>.and (<>#in true) - .local_symbol + .local (<>.maybe ..alias) ..nilable))) @@ -97,18 +97,18 @@ (def: common_method (Parser Common_Method) ($_ <>.and - .local_symbol + .local (<>.maybe ..alias) (.tuple (<>.some ..nilable)) - (<>.parses? (.this! (' "io"))) - (<>.parses? (.this! (' "try"))) + (<>.parses? (.this (' "io"))) + (<>.parses? (.this (' "try"))) ..nilable)) (def: input_variables (-> (List Nilable) (List [Bit Code])) (|>> list.enumeration (list#each (function (_ [idx [nilable? type]]) - [nilable? (|> idx %.nat code.local_symbol)])))) + [nilable? (|> idx %.nat code.local)])))) (def: (nilable_type [nilable? type]) (-> Nilable Code) @@ -206,7 +206,7 @@ (case import {#Function [name alias inputsT io? try? outputT]} (let [imported (` ("scheme constant" (~ (code.text name))))] - (in (list (..make_function (code.local_symbol (maybe.else name alias)) + (in (list (..make_function (code.local (maybe.else name alias)) g!temp imported inputsT @@ -216,7 +216,7 @@ {#Constant [_ name alias fieldT]} (let [imported (` ("scheme constant" (~ (code.text name))))] - (in (list (` ((~! syntax:) ((~ (code.local_symbol (maybe.else name alias)))) + (in (list (` ((~! syntax:) ((~ (code.local (maybe.else name alias)))) (# (~! meta.monad) (~' in) (list (` (.as (~ (nilable_type fieldT)) (~ imported)))))))))) ))) diff --git a/stdlib/source/library/lux/ffi/export.js.lux b/stdlib/source/library/lux/ffi/export.js.lux index a73437f72..ffe1daa6a 100644 --- a/stdlib/source/library/lux/ffi/export.js.lux +++ b/stdlib/source/library/lux/ffi/export.js.lux @@ -40,10 +40,10 @@ (-> Code (Meta [Text Code])) (|>> (list) (.result (<| .form - (<>.after (.text! "lux def")) + (<>.after (.this_text "lux def")) (<>.before .any) ($_ <>.and - .local_symbol + .local .any))) meta.lifted)) diff --git a/stdlib/source/library/lux/ffi/export.jvm.lux b/stdlib/source/library/lux/ffi/export.jvm.lux index 3368f1671..fa1631922 100644 --- a/stdlib/source/library/lux/ffi/export.jvm.lux +++ b/stdlib/source/library/lux/ffi/export.jvm.lux @@ -32,7 +32,7 @@ (def: constant (Parser Constant) - .local_symbol) + .local) (type: Function (Record @@ -44,10 +44,10 @@ (Parser Function) (.form ($_ <>.and - (<>.else (list) (.tuple (<>.some .local_symbol))) - .local_symbol + (<>.else (list) (.tuple (<>.some .local))) + .local (.tuple (<>.some ($_ <>.and - .local_symbol + .local .any ))) ))) @@ -64,7 +64,7 @@ (..api ..function) )) -(syntax: .public (export: [api .local_symbol +(syntax: .public (export: [api .local exports (<>.many ..export)]) (let [initialization (is (List (API Constant)) (list.all (.function (_ it) @@ -75,19 +75,19 @@ _ {.#None})) exports))] - (in (list (` (//.class: "final" (~ (code.local_symbol api)) + (in (list (` (//.class: "final" (~ (code.local api)) (~+ (list#each (.function (_ it) (case it {#Constant [name type term]} - (` ("public" "final" "static" (~ (code.local_symbol name)) (~ type))) + (` ("public" "final" "static" (~ (code.local name)) (~ type))) {#Function [[variables name requirements] type term]} (` ("public" "strict" "static" - [(~+ (list#each code.local_symbol variables))] - ((~ (code.local_symbol name)) + [(~+ (list#each code.local variables))] + ((~ (code.local name)) [(~+ (|> requirements (list#each (.function (_ [name type]) - (list (code.local_symbol name) + (list (code.local name) type))) list#conjoint))]) (~ type) diff --git a/stdlib/source/library/lux/ffi/export.lua.lux b/stdlib/source/library/lux/ffi/export.lua.lux index 1c53e9153..33601347b 100644 --- a/stdlib/source/library/lux/ffi/export.lua.lux +++ b/stdlib/source/library/lux/ffi/export.lua.lux @@ -40,10 +40,10 @@ (-> Code (Meta [Text Code])) (|>> (list) (.result (<| .form - (<>.after (.text! "lux def")) + (<>.after (.this_text "lux def")) (<>.before .any) ($_ <>.and - .local_symbol + .local .any))) meta.lifted)) diff --git a/stdlib/source/library/lux/ffi/export.py.lux b/stdlib/source/library/lux/ffi/export.py.lux index 4d820443e..febcdaf89 100644 --- a/stdlib/source/library/lux/ffi/export.py.lux +++ b/stdlib/source/library/lux/ffi/export.py.lux @@ -40,10 +40,10 @@ (-> Code (Meta [Text Code])) (|>> (list) (.result (<| .form - (<>.after (.text! "lux def")) + (<>.after (.this_text "lux def")) (<>.before .any) ($_ <>.and - .local_symbol + .local .any))) meta.lifted)) diff --git a/stdlib/source/library/lux/ffi/export.rb.lux b/stdlib/source/library/lux/ffi/export.rb.lux index 51aab7008..59fba650f 100644 --- a/stdlib/source/library/lux/ffi/export.rb.lux +++ b/stdlib/source/library/lux/ffi/export.rb.lux @@ -78,10 +78,10 @@ (-> Code (Meta [Name Code])) (|>> (list) (.result (<| .form - (<>.after (.text! "lux def")) + (<>.after (.this_text "lux def")) (<>.before .any) ($_ <>.and - (.then ..name .local_symbol) + (.then ..name .local) .any))) meta.lifted)) diff --git a/stdlib/source/library/lux/macro.lux b/stdlib/source/library/lux/macro.lux index eb8fd2531..d0df9fc7b 100644 --- a/stdlib/source/library/lux/macro.lux +++ b/stdlib/source/library/lux/macro.lux @@ -1,6 +1,6 @@ (.using [library - [lux {"-" symbol} + [lux {"-" local symbol} [abstract ["[0]" monad {"+" do}]] [data @@ -100,7 +100,7 @@ ($_ text#composite "__gensym__" prefix) [""] code.symbol)))) -(def: (local_symbol ast) +(def: (local ast) (-> Code (Meta Text)) (case ast [_ {.#Symbol [_ name]}] @@ -119,7 +119,7 @@ (case tokens (pattern (list [_ {.#Tuple symbols}] body)) (do [! //.monad] - [symbol_names (monad.each ! ..local_symbol symbols) + [symbol_names (monad.each ! ..local symbols) .let [symbol_defs (list#conjoint (list#each (is (-> Text (List Code)) (function (_ name) (list (code.symbol ["" name]) (` (..symbol (~ (code.text name))))))) symbol_names))]] diff --git a/stdlib/source/library/lux/macro/code.lux b/stdlib/source/library/lux/macro/code.lux index 0ced45d10..4df6d86e0 100644 --- a/stdlib/source/library/lux/macro/code.lux +++ b/stdlib/source/library/lux/macro/code.lux @@ -1,6 +1,6 @@ (.using [library - [lux {"-" nat int rev symbol} + [lux {"-" nat int rev local global symbol} [abstract [equivalence {"+" Equivalence}]] [data @@ -58,7 +58,7 @@ (-> Text Code) [location.dummy { ["" name]}])] - [local_symbol .#Symbol]) + [local .#Symbol]) (implementation: .public equivalence (Equivalence Code) diff --git a/stdlib/source/library/lux/macro/pattern.lux b/stdlib/source/library/lux/macro/pattern.lux index 1b237996e..62d829875 100644 --- a/stdlib/source/library/lux/macro/pattern.lux +++ b/stdlib/source/library/lux/macro/pattern.lux @@ -57,7 +57,7 @@ [expected_type] [wrong_syntax_error] - [local_symbol$] + [local$] [list#reversed] [untemplated_list] @@ -146,7 +146,7 @@ (macro: .public (let tokens) (case tokens (pattern (list& [_meta {.#Form (list [_ {.#Symbol ["" name]}] pattern)}] body branches)) - (.let [g!whole (local_symbol$ name)] + (.let [g!whole (local$ name)] (meta#in (list& g!whole (.` (case (~ g!whole) (~ pattern) (~ body))) branches))) @@ -157,7 +157,7 @@ (macro: .public (|> tokens) (case tokens (pattern (list& [_meta {.#Form (list [_ {.#Symbol ["" name]}] [_ {.#Tuple steps}])}] body branches)) - (.let [g!name (local_symbol$ name)] + (.let [g!name (local$ name)] (meta#in (list& g!name (.` (.let [(~ g!name) (.|> (~ g!name) (~+ steps))] (~ body))) diff --git a/stdlib/source/library/lux/macro/syntax.lux b/stdlib/source/library/lux/macro/syntax.lux index 8530307be..7f76debb1 100644 --- a/stdlib/source/library/lux/macro/syntax.lux +++ b/stdlib/source/library/lux/macro/syntax.lux @@ -48,7 +48,7 @@ (/export.parser ($_ <>.and (.form ($_ <>.and - .local_symbol + .local (.tuple (<>.some .any)))) .any))) diff --git a/stdlib/source/library/lux/macro/syntax/check.lux b/stdlib/source/library/lux/macro/syntax/check.lux index 00f01aa3f..da0ad9ca1 100644 --- a/stdlib/source/library/lux/macro/syntax/check.lux +++ b/stdlib/source/library/lux/macro/syntax/check.lux @@ -38,6 +38,6 @@ (def: .public parser (Parser Check) (<| .form - (<>.after (.text! ..extension)) + (<>.after (.this_text ..extension)) (<>.and .any .any))) diff --git a/stdlib/source/library/lux/macro/syntax/declaration.lux b/stdlib/source/library/lux/macro/syntax/declaration.lux index d817fa193..f6c92855e 100644 --- a/stdlib/source/library/lux/macro/syntax/declaration.lux +++ b/stdlib/source/library/lux/macro/syntax/declaration.lux @@ -28,17 +28,17 @@ (def: .public parser (Parser Declaration) - (<>.either (<>.and .local_symbol + (<>.either (<>.and .local (<>#in (list))) - (.form (<>.and .local_symbol - (<>.some .local_symbol))))) + (.form (<>.and .local + (<>.some .local))))) (def: .public (format value) (-> Declaration Code) - (let [g!name (code.local_symbol (the #name value))] + (let [g!name (code.local (the #name value))] (case (the #arguments value) {.#End} g!name arguments - (` ((~ g!name) (~+ (list#each code.local_symbol arguments))))))) + (` ((~ g!name) (~+ (list#each code.local arguments))))))) diff --git a/stdlib/source/library/lux/macro/syntax/definition.lux b/stdlib/source/library/lux/macro/syntax/definition.lux index c6b914bf3..af8e3baf0 100644 --- a/stdlib/source/library/lux/macro/syntax/definition.lux +++ b/stdlib/source/library/lux/macro/syntax/definition.lux @@ -53,7 +53,7 @@ (def: .public (format (open "_[0]")) (-> Definition Code) (` ((~ (code.text ..extension)) - (~ (code.local_symbol _#name)) + (~ (code.local _#name)) (~ (case _#value {.#Left check} (//check.format check) @@ -70,11 +70,11 @@ macro.full_expansion (meta.result compiler) <>.lifted)] - (<| (.local me_raw) + (<| (.locally me_raw) .form - (<>.after (.text! ..extension)) + (<>.after (.this_text ..extension)) ($_ <>.and - .local_symbol + .local (<>.or //check.parser .any) .bit diff --git a/stdlib/source/library/lux/macro/syntax/type/variable.lux b/stdlib/source/library/lux/macro/syntax/type/variable.lux index 5bb62d302..88dbd1be4 100644 --- a/stdlib/source/library/lux/macro/syntax/type/variable.lux +++ b/stdlib/source/library/lux/macro/syntax/type/variable.lux @@ -20,8 +20,8 @@ (def: .public format (-> Variable Code) - code.local_symbol) + code.local) (def: .public parser (Parser Variable) - .local_symbol) + .local) diff --git a/stdlib/source/library/lux/macro/template.lux b/stdlib/source/library/lux/macro/template.lux index d2260f584..778a5fe44 100644 --- a/stdlib/source/library/lux/macro/template.lux +++ b/stdlib/source/library/lux/macro/template.lux @@ -34,7 +34,7 @@ (syntax: .public (amount [parts (.tuple (<>.some .any))]) (in (list (code.nat (list.size parts))))) -(syntax: .public (with_locals [locals (.tuple (<>.some .local_symbol)) +(syntax: .public (with_locals [locals (.tuple (<>.some .local)) body .any]) (do [! meta.monad] [g!locals (|> locals @@ -42,7 +42,7 @@ (monad.all !))] (in (list (` (.with_expansions [(~+ (|> (list.zipped/2 locals g!locals) (list#each (function (_ [name symbol]) - (list (code.local_symbol name) (as_is symbol)))) + (list (code.local name) (as_is symbol)))) list#conjoint))] (~ body))))))) @@ -63,7 +63,7 @@ .text (if module_side? full_symbol - (<>.either .local_symbol + (<>.either .local full_symbol)) (<>#each bit#encoded .bit) (<>#each nat#encoded .nat) @@ -90,7 +90,7 @@ {.#Right simple} (in (list (|> simple (text.interposed "") )))))] - [symbol code.local_symbol code.symbol] + [symbol code.local code.symbol] ) (type: Environment @@ -145,8 +145,8 @@ (def: local (Parser Local) (do <>.monad - [[name parameters] (.form (<>.and .local_symbol - (<>.many .local_symbol))) + [[name parameters] (.form (<>.and .local + (<>.many .local))) template (.tuple (<>.some .any))] (in [#name name #parameters parameters diff --git a/stdlib/source/library/lux/program.lux b/stdlib/source/library/lux/program.lux index 4b25a55b2..c4a3b34a4 100644 --- a/stdlib/source/library/lux/program.lux +++ b/stdlib/source/library/lux/program.lux @@ -22,7 +22,7 @@ (def: arguments^ (.Parser Arguments) - (<>.or .local_symbol + (<>.or .local (.tuple (<>.some .any)))) (syntax: .public (program: [args ..arguments^ diff --git a/stdlib/source/library/lux/target/js.lux b/stdlib/source/library/lux/target/js.lux index 6243e3f11..d101afd55 100644 --- a/stdlib/source/library/lux/target/js.lux +++ b/stdlib/source/library/lux/target/js.lux @@ -181,7 +181,7 @@ (text.enclosed ["{" close])))) - (def: .public (function! name inputs body) + (def: .public (function_definition name inputs body) (-> Var (List Var) Statement Statement) (|> body ..block @@ -195,7 +195,7 @@ (def: .public (function name inputs body) (-> Var (List Var) Statement Computation) - (|> (..function! name inputs body) + (|> (..function_definition name inputs body) representation ..expression abstraction)) diff --git a/stdlib/source/library/lux/target/lua.lux b/stdlib/source/library/lux/target/lua.lux index 2269e015b..a6e63c04c 100644 --- a/stdlib/source/library/lux/target/lua.lux +++ b/stdlib/source/library/lux/target/lua.lux @@ -378,7 +378,7 @@ 0 (.list) _ (|> (-- arity) (enum.range n.enum 0) - (list#each (|>> %.nat code.local_symbol)))))) + (list#each (|>> %.nat code.local)))))) (syntax: (arity_types [arity .nat]) (in (list.repeated arity (` ..Expression)))) diff --git a/stdlib/source/library/lux/target/php.lux b/stdlib/source/library/lux/target/php.lux index f0a2d560c..a8bfa37a1 100644 --- a/stdlib/source/library/lux/target/php.lux +++ b/stdlib/source/library/lux/target/php.lux @@ -237,7 +237,7 @@ 0 (.list) _ (|> (-- arity) (enum.range n.enum 0) - (list#each (|>> %.nat code.local_symbol)))))) + (list#each (|>> %.nat code.local)))))) (syntax: (arity_types [arity .nat]) (in (list.repeated arity (` ..Expression)))) diff --git a/stdlib/source/library/lux/target/python.lux b/stdlib/source/library/lux/target/python.lux index 0e4e279cb..277e2c947 100644 --- a/stdlib/source/library/lux/target/python.lux +++ b/stdlib/source/library/lux/target/python.lux @@ -456,7 +456,7 @@ 0 (.list) _ (|> (-- arity) (enum.range n.enum 0) - (list#each (|>> %.nat code.local_symbol)))))) + (list#each (|>> %.nat code.local)))))) (syntax: (arity_types [arity .nat]) (in (list.repeated arity (` (Expression Any))))) diff --git a/stdlib/source/library/lux/target/r.lux b/stdlib/source/library/lux/target/r.lux index c4fa1d87a..631b0b74d 100644 --- a/stdlib/source/library/lux/target/r.lux +++ b/stdlib/source/library/lux/target/r.lux @@ -214,7 +214,7 @@ 0 (.list) _ (|> arity list.indices - (list#each (|>> %.nat code.local_symbol)))))) + (list#each (|>> %.nat code.local)))))) (syntax: (arity_types [arity .nat]) (in (list.repeated arity (` ..Expression)))) diff --git a/stdlib/source/library/lux/target/ruby.lux b/stdlib/source/library/lux/target/ruby.lux index a89537de1..ba29eb81a 100644 --- a/stdlib/source/library/lux/target/ruby.lux +++ b/stdlib/source/library/lux/target/ruby.lux @@ -486,7 +486,7 @@ 0 (.list) _ (|> (-- arity) (enum.range n.enum 0) - (list#each (|>> %.nat code.local_symbol)))))) + (list#each (|>> %.nat code.local)))))) (syntax: (arity_types [arity .nat]) (in (list.repeated arity (` ..Expression)))) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux index 999331c91..49d9df8ca 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux @@ -1351,8 +1351,8 @@ _ {.#None})))] - [pass! #Pass] - [hint! #Hint] + [pass #Pass] + [hint #Hint] ) (template [ ] @@ -1426,12 +1426,12 @@ (|>> {#Pass}) (|>> {#Hint})) (method_signature method_style method)))))))] - (case (list.all pass! candidates) + (case (list.all pass candidates) {.#Item method {.#End}} (in method) {.#End} - (/////analysis.except ..no_candidates [actual_class_tvars class_name method_name actual_method_tvars inputsJT (list.all hint! candidates)]) + (/////analysis.except ..no_candidates [actual_class_tvars class_name method_name actual_method_tvars inputsJT (list.all hint candidates)]) {.#Item method alternatives} (if allow_inheritance? @@ -1460,12 +1460,12 @@ (|>> {#Pass}) (|>> {#Hint})) (constructor_signature constructor))))))] - (case (list.all pass! candidates) + (case (list.all pass candidates) {.#Item constructor {.#End}} (in constructor) {.#End} - (/////analysis.except ..no_candidates [actual_class_tvars class_name ..constructor_method actual_method_tvars inputsJT (list.all hint! candidates)]) + (/////analysis.except ..no_candidates [actual_class_tvars class_name ..constructor_method actual_method_tvars inputsJT (list.all hint candidates)]) candidates (/////analysis.except ..too_many_candidates [actual_class_tvars class_name ..constructor_method actual_method_tvars inputsJT candidates])))) @@ -1807,7 +1807,7 @@ (def: .public abstract_method_definition (Parser (Abstract_Method Code)) (<| .form - (<>.after (.text! ..abstract_tag)) + (<>.after (.this_text ..abstract_tag)) ($_ <>.and .text ..visibility @@ -1869,7 +1869,7 @@ (def: .public constructor_definition (Parser (Constructor Code)) (<| .form - (<>.after (.text! ..constructor_tag)) + (<>.after (.this_text ..constructor_tag)) ($_ <>.and ..visibility .bit @@ -1949,7 +1949,7 @@ (def: .public virtual_method_definition (Parser (Virtual_Method Code)) (<| .form - (<>.after (.text! ..virtual_tag)) + (<>.after (.this_text ..virtual_tag)) ($_ <>.and .text ..visibility @@ -2047,7 +2047,7 @@ (def: .public static_method_definition (Parser (Static_Method Code)) (<| .form - (<>.after (.text! ..static_tag)) + (<>.after (.this_text ..static_tag)) ($_ <>.and .text ..visibility @@ -2121,7 +2121,7 @@ (def: .public overriden_method_definition (Parser (Overriden_Method Code)) (<| .form - (<>.after (.text! ..overriden_tag)) + (<>.after (.this_text ..overriden_tag)) ($_ <>.and ..class .text diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux index 0ec22f549..ab72fe131 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux @@ -128,7 +128,7 @@ (Parser (Modifier class.Class)) (`` ($_ <>.either (~~ (template [