From 971767f1eafb22208912353d8709f11081f2d3c8 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 14 Sep 2021 02:56:22 -0400 Subject: Re-named "Identifier" to "Symbol". --- stdlib/source/test/lux.lux | 70 +++++++++++----------- stdlib/source/test/lux/control/parser/code.lux | 4 +- stdlib/source/test/lux/control/remember.lux | 4 +- stdlib/source/test/lux/data/format/json.lux | 2 +- stdlib/source/test/lux/data/format/xml.lux | 16 ++--- stdlib/source/test/lux/data/text/regex.lux | 2 +- stdlib/source/test/lux/documentation.lux | 4 +- stdlib/source/test/lux/ffi.jvm.lux | 2 +- stdlib/source/test/lux/macro.lux | 30 +++++----- stdlib/source/test/lux/macro/code.lux | 8 +-- stdlib/source/test/lux/macro/local.lux | 2 +- stdlib/source/test/lux/macro/template.lux | 6 +- stdlib/source/test/lux/meta/symbol.lux | 2 +- .../language/lux/phase/analysis/function.lux | 4 +- .../language/lux/phase/analysis/reference.lux | 6 +- .../test/lux/tool/compiler/language/lux/syntax.lux | 2 +- stdlib/source/test/lux/type/resource.lux | 2 +- 17 files changed, 83 insertions(+), 83 deletions(-) (limited to 'stdlib/source/test') diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux index c36f8b11f..dc23cd309 100644 --- a/stdlib/source/test/lux.lux +++ b/stdlib/source/test/lux.lux @@ -297,7 +297,7 @@ ((/.<<| (n.* factor) ++) start))) ))) -(def: example_identifier "YOLO") +(def: example_symbol "YOLO") (def: i8 8) (def: current_module @@ -315,21 +315,21 @@ (code#= (code.rev .2) (/.' .2)) (code#= (code.frac +3.4) (/.' +3.4)) (code#= (code.text "5") (/.' "5")) - (code#= (code.identifier ["" "example_identifier"]) - (/.' example_identifier)) - (code#= (code.identifier [/.prelude_module "example_identifier"]) - (/.' .example_identifier)) - (code#= (code.identifier [..current_module "example_identifier"]) - (/.' ..example_identifier)) + (code#= (code.symbol ["" "example_symbol"]) + (/.' example_symbol)) + (code#= (code.symbol [/.prelude_module "example_symbol"]) + (/.' .example_symbol)) + (code#= (code.symbol [..current_module "example_symbol"]) + (/.' ..example_symbol)) (code#= (code.form (list (code.nat 6) (code.int +7) (code.rev .8))) (/.' (6 +7 .8))) (code#= (code.variant (list (code.frac +9.0) (code.text "9") - (code.identifier ["" "i8"]))) + (code.symbol ["" "i8"]))) (/.' {+9.0 "9" i8})) (code#= (code.tuple (list (code.frac +9.0) (code.text "9") - (code.identifier ["" "i8"]))) + (code.symbol ["" "i8"]))) (/.' [+9.0 "9" i8])) (not (code#= (code.nat example_nat) (/.' (~ (code.nat example_nat))))) @@ -345,21 +345,21 @@ (code#= (code.rev .2) (/.` .2)) (code#= (code.frac +3.4) (/.` +3.4)) (code#= (code.text "5") (/.` "5")) - (code#= (code.identifier [..current_module "example_identifier"]) - (/.` example_identifier)) - (code#= (code.identifier [/.prelude_module "example_identifier"]) - (/.` .example_identifier)) - (code#= (code.identifier [..current_module "example_identifier"]) - (/.` ..example_identifier)) + (code#= (code.symbol [..current_module "example_symbol"]) + (/.` example_symbol)) + (code#= (code.symbol [/.prelude_module "example_symbol"]) + (/.` .example_symbol)) + (code#= (code.symbol [..current_module "example_symbol"]) + (/.` ..example_symbol)) (code#= (code.form (list (code.nat 6) (code.int +7) (code.rev .8))) (/.` (6 +7 .8))) (code#= (code.variant (list (code.frac +9.0) (code.text "9") - (code.identifier [..current_module "i8"]))) + (code.symbol [..current_module "i8"]))) (/.` {+9.0 "9" i8})) (code#= (code.tuple (list (code.frac +9.0) (code.text "9") - (code.identifier [..current_module "i8"]))) + (code.symbol [..current_module "i8"]))) (/.` [+9.0 "9" i8])) (code#= (code.nat example_nat) (/.` (~ (code.nat example_nat)))))))) @@ -374,21 +374,21 @@ (code#= (code.rev .2) (/.`' .2)) (code#= (code.frac +3.4) (/.`' +3.4)) (code#= (code.text "5") (/.`' "5")) - (code#= (code.identifier ["" "example_identifier"]) - (/.`' example_identifier)) - (code#= (code.identifier [/.prelude_module "example_identifier"]) - (/.`' .example_identifier)) - (code#= (code.identifier [..current_module "example_identifier"]) - (/.`' ..example_identifier)) + (code#= (code.symbol ["" "example_symbol"]) + (/.`' example_symbol)) + (code#= (code.symbol [/.prelude_module "example_symbol"]) + (/.`' .example_symbol)) + (code#= (code.symbol [..current_module "example_symbol"]) + (/.`' ..example_symbol)) (code#= (code.form (list (code.nat 6) (code.int +7) (code.rev .8))) (/.`' (6 +7 .8))) (code#= (code.variant (list (code.frac +9.0) (code.text "9") - (code.identifier ["" "i8"]))) + (code.symbol ["" "i8"]))) (/.`' {+9.0 "9" i8})) (code#= (code.tuple (list (code.frac +9.0) (code.text "9") - (code.identifier ["" "i8"]))) + (code.symbol ["" "i8"]))) (/.`' [+9.0 "9" i8])) (code#= (code.nat example_nat) (/.`' (~ (code.nat example_nat)))))))) @@ -1090,19 +1090,19 @@ )) (for [@.old (as_is)] - (as_is (syntax: (for_bindings|test [fn/0 .local_identifier - var/0 .local_identifier - let/0 .local_identifier + (as_is (syntax: (for_bindings|test [fn/0 .local_symbol + var/0 .local_symbol + let/0 .local_symbol - fn/1 .local_identifier - var/1 .local_identifier - let/1 .local_identifier + fn/1 .local_symbol + var/1 .local_symbol + let/1 .local_symbol - fn/2 .local_identifier - var/2 .local_identifier - let/2 .local_identifier + fn/2 .local_symbol + var/2 .local_symbol + let/2 .local_symbol - let/3 .local_identifier]) + let/3 .local_symbol]) (in (list (code.bit (case (value@ .#scopes *lux*) (^ (list& scope/2 _)) (let [locals/2 (value@ .#locals scope/2) diff --git a/stdlib/source/test/lux/control/parser/code.lux b/stdlib/source/test/lux/control/parser/code.lux index aee053104..bbd5de948 100644 --- a/stdlib/source/test/lux/control/parser/code.lux +++ b/stdlib/source/test/lux/control/parser/code.lux @@ -75,8 +75,8 @@ [/.rev /.rev! random.rev code.rev rev.equivalence] [/.frac /.frac! random.safe_frac code.frac frac.equivalence] [/.text /.text! (random.unicode 1) code.text text.equivalence] - [/.identifier /.identifier! ..random_symbol code.identifier symbol.equivalence] - [/.local_identifier /.local_identifier! (random.unicode 1) code.local_identifier text.equivalence] + [/.symbol /.symbol! ..random_symbol code.symbol symbol.equivalence] + [/.local_symbol /.local_symbol! (random.unicode 1) code.local_symbol text.equivalence] )) (~~ (template [ ] [(do [! random.monad] diff --git a/stdlib/source/test/lux/control/remember.lux b/stdlib/source/test/lux/control/remember.lux index a8eb15141..8c8162d24 100644 --- a/stdlib/source/test/lux/control/remember.lux +++ b/stdlib/source/test/lux/control/remember.lux @@ -34,7 +34,7 @@ (def: (memory macro deadline message focus) (-> Symbol Date Text (Maybe Code) Code) - (` ((~ (code.identifier macro)) + (` ((~ (code.symbol macro)) (~ (code.text (%.date deadline))) (~ (code.text message)) (~+ (case focus @@ -62,7 +62,7 @@ {.#Some focus} (text.contains? (%.code focus) failure)))) -(syntax: (test_macro [macro .identifier +(syntax: (test_macro [macro .symbol extra .text]) (let [now (io.run! instant.now) today (instant.date now) diff --git a/stdlib/source/test/lux/data/format/json.lux b/stdlib/source/test/lux/data/format/json.lux index f12831ab8..f3d3b9b93 100644 --- a/stdlib/source/test/lux/data/format/json.lux +++ b/stdlib/source/test/lux/data/format/json.lux @@ -58,7 +58,7 @@ (syntax: (string []) (do meta.monad - [value (macro.identifier "string")] + [value (macro.symbol "string")] (in (list (code.text (%.code value)))))) (def: .public test diff --git a/stdlib/source/test/lux/data/format/xml.lux b/stdlib/source/test/lux/data/format/xml.lux index 840455f41..4c56dc5e2 100644 --- a/stdlib/source/test/lux/data/format/xml.lux +++ b/stdlib/source/test/lux/data/format/xml.lux @@ -1,6 +1,6 @@ (.module: [library - [lux {"-" char} + [lux {"-" char symbol} ["_" test {"+" Test}] [abstract [monad {"+" Monad do}] @@ -51,7 +51,7 @@ [size (..size bottom top)] (random.text ..char size))) -(def: identifier +(def: symbol (Random Symbol) (random.and (..text 0 10) (..text 1 10))) @@ -63,8 +63,8 @@ (do random.monad [size (..size 0 2)] ($_ random.and - ..identifier - (random.dictionary symbol.hash size ..identifier (..text 0 10)) + ..symbol + (random.dictionary symbol.hash size ..symbol (..text 0 10)) (random.list size random))))))) (def: .public test @@ -78,14 +78,14 @@ ($codec.spec /.equivalence /.codec ..random)) (do [! random.monad] - [(^@ identifier [namespace name]) ..identifier] + [(^@ symbol [namespace name]) ..symbol] (`` ($_ _.and (~~ (template [ ] [(_.cover [ ] (and (text#= name ( ["" name])) - (let [identifier ( identifier)] - (and (text.starts_with? namespace identifier) - (text.ends_with? name identifier)))))] + (let [symbol ( symbol)] + (and (text.starts_with? namespace symbol) + (text.ends_with? name symbol)))))] [/.Tag /.tag] [/.Attribute /.attribute] diff --git a/stdlib/source/test/lux/data/text/regex.lux b/stdlib/source/test/lux/data/text/regex.lux index 2eb5ad7e0..eeb1c9b18 100644 --- a/stdlib/source/test/lux/data/text/regex.lux +++ b/stdlib/source/test/lux/data/text/regex.lux @@ -55,7 +55,7 @@ (syntax: (should_check [pattern .any regex .any input .any]) - (macro.with_identifiers [g!message g!_] + (macro.with_symbols [g!message g!_] (in (list (` (|> (~ input) (.result (~ regex)) (case> (^ {try.#Success (~ pattern)}) diff --git a/stdlib/source/test/lux/documentation.lux b/stdlib/source/test/lux/documentation.lux index e686dcd21..4e59139c0 100644 --- a/stdlib/source/test/lux/documentation.lux +++ b/stdlib/source/test/lux/documentation.lux @@ -52,7 +52,7 @@ (_.for [/.Definition] ($_ _.and (_.cover [/.default] - (case (`` (/.default (~~ (template.identifier [.._] [g!default])))) + (case (`` (/.default (~~ (template.symbol [.._] [g!default])))) (^ (list definition)) (and (|> definition (value@ /.#definition) @@ -104,7 +104,7 @@ _ false)))) )) - (_.cover [/.unqualified_identifier] + (_.cover [/.unqualified_symbol] (`` (and (~~ (template [] [(macro_error )] diff --git a/stdlib/source/test/lux/ffi.jvm.lux b/stdlib/source/test/lux/ffi.jvm.lux index 9f5ea29e5..5779817d2 100644 --- a/stdlib/source/test/lux/ffi.jvm.lux +++ b/stdlib/source/test/lux/ffi.jvm.lux @@ -600,7 +600,7 @@ Test ($_ _.and (_.cover [/.class_names_cannot_contain_periods] - (with_expansions [ (template.identifier ["java.lang.Float"])] + (with_expansions [ (template.symbol ["java.lang.Float"])] (not (expands? (/.import: ))))) (_.cover [/.class_name_cannot_be_a_type_variable] (and (not (expands? (/.import: (java/lang/Double a) diff --git a/stdlib/source/test/lux/macro.lux b/stdlib/source/test/lux/macro.lux index 8553e6e16..6cf91e49f 100644 --- a/stdlib/source/test/lux/macro.lux +++ b/stdlib/source/test/lux/macro.lux @@ -51,20 +51,20 @@ token .any]) (in (list.repeated times token))) -(syntax: (fresh_identifier []) +(syntax: (fresh_symbol []) (do meta.monad - [g!fresh (/.identifier "fresh")] + [g!fresh (/.symbol "fresh")] (in (list g!fresh)))) (def: random_lux (Random [Nat Text .Lux]) (do [! random.monad] [seed random.nat - identifier_prefix (random.ascii/upper 1) + symbol_prefix (random.ascii/upper 1) .let [macro_module (symbol.module (symbol /._)) current_module (symbol.module (symbol .._))]] (in [seed - identifier_prefix + symbol_prefix [.#info [.#target "" .#version "" .#mode {.#Build}] @@ -103,7 +103,7 @@ (def: expander Test (do [! random.monad] - [[seed identifier_prefix lux] ..random_lux + [[seed symbol_prefix lux] ..random_lux pow/1 (# ! each code.nat random.nat) @@ -148,27 +148,27 @@ (<| (_.covering /._) ($_ _.and (do [! random.monad] - [[seed identifier_prefix lux] ..random_lux] + [[seed symbol_prefix lux] ..random_lux] ($_ _.and - (_.cover [/.identifier] - (|> (/.identifier identifier_prefix) + (_.cover [/.symbol] + (|> (/.symbol symbol_prefix) (# meta.monad each %.code) (meta.result lux) - (!expect (^multi {try.#Success actual_identifier} - (and (text.contains? identifier_prefix actual_identifier) - (text.contains? (%.nat seed) actual_identifier)))))) + (!expect (^multi {try.#Success actual_symbol} + (and (text.contains? symbol_prefix actual_symbol) + (text.contains? (%.nat seed) actual_symbol)))))) (_.cover [/.wrong_syntax_error] (|> (/.single_expansion (` (/.log_single_expansion!))) (meta.result lux) (!expect (^multi {try.#Failure error} (text.contains? (/.wrong_syntax_error (symbol /.log_single_expansion!)) error))))) - (_.cover [/.with_identifiers] - (with_expansions [ (fresh_identifier)] - (|> (/.with_identifiers [] + (_.cover [/.with_symbols] + (with_expansions [ (fresh_symbol)] + (|> (/.with_symbols [] (# meta.monad in )) (meta.result lux) - (!expect (^multi {try.#Success [_ {.#Identifier ["" actual]}]} + (!expect (^multi {try.#Success [_ {.#Symbol ["" actual]}]} (text.contains? (template.text []) actual)))))) )) diff --git a/stdlib/source/test/lux/macro/code.lux b/stdlib/source/test/lux/macro/code.lux index 8a0ab7ef1..f1a983c3d 100644 --- a/stdlib/source/test/lux/macro/code.lux +++ b/stdlib/source/test/lux/macro/code.lux @@ -52,7 +52,7 @@ (random#each /.rev random.rev) (random#each /.frac random.safe_frac) (random#each /.text ..random_text) - (random#each /.identifier ..random_symbol) + (random#each /.symbol ..random_symbol) (random#each /.form (..random_sequence random)) (random#each /.variant (..random_sequence random)) (random#each /.tuple (..random_sequence random)) @@ -93,7 +93,7 @@ (random#each /.rev random.rev) (random#each /.frac random.safe_frac) (random#each /.text ..random_text) - (random#each /.identifier ..random_symbol)))] + (random#each /.symbol ..random_symbol)))] (in [sample sample])) (for_sequence /.form) (for_sequence /.variant) @@ -125,7 +125,7 @@ [/.rev random.rev .#Rev] [/.frac random.safe_frac .#Frac] [/.text ..random_text .#Text] - [/.identifier ..random_symbol .#Identifier] + [/.symbol ..random_symbol .#Symbol] [/.form (..random_sequence ..random) .#Form] [/.variant (..random_sequence ..random) .#Variant] [/.tuple (..random_sequence ..random) .#Tuple])) @@ -146,7 +146,7 @@ ( expected))) ))] - [/.local_identifier ..random_text .#Identifier] + [/.local_symbol ..random_text .#Symbol] ))))) (def: .public test diff --git a/stdlib/source/test/lux/macro/local.lux b/stdlib/source/test/lux/macro/local.lux index 8cbc19a0c..5a59c735f 100644 --- a/stdlib/source/test/lux/macro/local.lux +++ b/stdlib/source/test/lux/macro/local.lux @@ -46,7 +46,7 @@ constant .any pre_remove .bit body .any]) - (macro.with_identifiers [g!output] + (macro.with_symbols [g!output] (do meta.monad [pop! (/.push (list [name (..constant constant)])) [module short] (meta.normal name) diff --git a/stdlib/source/test/lux/macro/template.lux b/stdlib/source/test/lux/macro/template.lux index c2001cb23..2fb361c01 100644 --- a/stdlib/source/test/lux/macro/template.lux +++ b/stdlib/source/test/lux/macro/template.lux @@ -61,11 +61,11 @@ (case (/.text ) ' true _ false)) - (_.cover [/.identifier] - (and (case (`` (symbol (~~ (/.identifier )))) + (_.cover [/.symbol] + (and (case (`` (symbol (~~ (/.symbol )))) ["" '] true _ false) - (case (`` (symbol (~~ (/.identifier )))) + (case (`` (symbol (~~ (/.symbol )))) [' '] true _ false) )) diff --git a/stdlib/source/test/lux/meta/symbol.lux b/stdlib/source/test/lux/meta/symbol.lux index 84f87e9fa..83fb1eefd 100644 --- a/stdlib/source/test/lux/meta/symbol.lux +++ b/stdlib/source/test/lux/meta/symbol.lux @@ -61,7 +61,7 @@ (_.for [.symbol] (let [(^open "/#[0]") /.equivalence] ($_ _.and - (_.test "Can obtain Symbol from identifier." + (_.test "Can obtain Symbol from a symbol." (and (/#= [.prelude_module "yolo"] (.symbol .yolo)) (/#= ["test/lux/meta/symbol" "yolo"] (.symbol ..yolo)) (/#= ["" "yolo"] (.symbol yolo)) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux index 8ab7706c7..ebd144e86 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux @@ -57,7 +57,7 @@ arg_name (|> (r.unicode 5) (r.only (|>> (text#= func_name) not))) [outputT outputC] _primitive.primitive [inputT _] _primitive.primitive - .let [g!arg (code.local_identifier arg_name)]] + .let [g!arg (code.local_symbol arg_name)]] (<| (_.context (%.symbol (symbol /.function))) ($_ _.and (_.test "Can analyse function." @@ -76,7 +76,7 @@ _structure.check_succeeds))) (_.test "The function's name is bound to the function's type." (|> (//type.with_type (Rec self (-> inputT self)) - (/.function _primitive.phase func_name arg_name archive.empty (code.local_identifier func_name))) + (/.function _primitive.phase func_name arg_name archive.empty (code.local_symbol func_name))) _structure.check_succeeds)) )))) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/reference.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/reference.lux index b8da226ad..d60b78f35 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/reference.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/reference.lux @@ -59,7 +59,7 @@ (//module.import def_module) (in []))] (//type.with_inference - (_primitive.phase archive.empty (code.identifier [def_module var_name])))))) + (_primitive.phase archive.empty (code.symbol [def_module var_name])))))) (phase.result _primitive.state) check!)) @@ -77,7 +77,7 @@ (|> (//scope.with_scope scope_name (//scope.with_local [var_name expectedT] (//type.with_inference - (_primitive.phase archive.empty (code.local_identifier var_name))))) + (_primitive.phase archive.empty (code.local_symbol var_name))))) (phase.result _primitive.state) (case> (^ {try.#Success [inferredT {////analysis.#Reference (////reference.local var)}]}) (and (type#= expectedT inferredT) @@ -90,7 +90,7 @@ (|> (do phase.monad [_ (//module.define var_name {.#Right [false expectedT []]})] (//type.with_inference - (_primitive.phase archive.empty (code.identifier def_name)))) + (_primitive.phase archive.empty (code.symbol def_name)))) (//module.with_module 0 def_module) (phase.result _primitive.state) (case> (^ {try.#Success [_ inferredT {////analysis.#Reference (////reference.constant constant_name)}]}) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/syntax.lux b/stdlib/source/test/lux/tool/compiler/language/lux/syntax.lux index 639132d1b..16bb01507 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/syntax.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/syntax.lux @@ -48,7 +48,7 @@ (do r.monad [size (|> r.nat (r#each (n.% 20)))] (|> (r.ascii/upper_alpha size) (r#each code.text))) - (|> symbol^ (r#each code.identifier)) + (|> symbol^ (r#each code.symbol)) (|> symbol^ (r#each code.tag)))) simple^ (: (Random Code) ($_ r.either diff --git a/stdlib/source/test/lux/type/resource.lux b/stdlib/source/test/lux/type/resource.lux index aad93d0a2..132674e8b 100644 --- a/stdlib/source/test/lux/type/resource.lux +++ b/stdlib/source/test/lux/type/resource.lux @@ -155,7 +155,7 @@ )) ))))) -(syntax: (with_error [exception .identifier +(syntax: (with_error [exception .symbol to_expand .any]) (monad.do meta.monad [[_ _ exception] (meta.export exception)] -- cgit v1.2.3