diff options
Diffstat (limited to 'stdlib/source/test/lux/control/parser')
-rw-r--r-- | stdlib/source/test/lux/control/parser/analysis.lux | 5 | ||||
-rw-r--r-- | stdlib/source/test/lux/control/parser/binary.lux | 13 | ||||
-rw-r--r-- | stdlib/source/test/lux/control/parser/code.lux | 11 | ||||
-rw-r--r-- | stdlib/source/test/lux/control/parser/synthesis.lux | 7 | ||||
-rw-r--r-- | stdlib/source/test/lux/control/parser/type.lux | 5 | ||||
-rw-r--r-- | stdlib/source/test/lux/control/parser/xml.lux | 29 |
6 files changed, 38 insertions, 32 deletions
diff --git a/stdlib/source/test/lux/control/parser/analysis.lux b/stdlib/source/test/lux/control/parser/analysis.lux index 57f6c1a77..730fd4cc3 100644 --- a/stdlib/source/test/lux/control/parser/analysis.lux +++ b/stdlib/source/test/lux/control/parser/analysis.lux @@ -10,7 +10,6 @@ ["[0]" exception] ["<>" parser]] [data - ["[0]" name ("[1]#[0]" equivalence)] ["[0]" bit ("[1]#[0]" equivalence)] ["[0]" text ("[1]#[0]" equivalence)] [collection @@ -22,6 +21,8 @@ ["i" int] ["f" frac] ["r" rev]]] + [meta + ["[0]" symbol ("[1]#[0]" equivalence)]] [tool [compiler [reference {"+" Constant} @@ -88,7 +89,7 @@ [/.text /.text! (random.unicode 10) analysis.text text#=] [/.local /.local! random.nat analysis.variable/local n.=] [/.foreign /.foreign! random.nat analysis.variable/foreign n.=] - [/.constant /.constant! ..constant analysis.constant name#=] + [/.constant /.constant! ..constant analysis.constant symbol#=] )) (do [! random.monad] [expected random.bit] diff --git a/stdlib/source/test/lux/control/parser/binary.lux b/stdlib/source/test/lux/control/parser/binary.lux index f7809b34d..3bf3363c9 100644 --- a/stdlib/source/test/lux/control/parser/binary.lux +++ b/stdlib/source/test/lux/control/parser/binary.lux @@ -17,7 +17,6 @@ ["[0]" binary] ["[0]" sum] ["[0]" bit] - ["[0]" name] ["[0]" text ("[1]#[0]" equivalence) ["%" format {"+" format}] [encoding @@ -37,7 +36,9 @@ ["[0]" i64] ["[0]" int] ["[0]" rev] - ["[0]" frac]]]]] + ["[0]" frac]]] + [meta + ["[0]" symbol]]]] [\\library ["[0]" /]]) @@ -67,8 +68,8 @@ (random.only ..utf8_conversion_does_not_alter? (random.unicode ..segment_size))) -(def: random_name - (Random Name) +(def: random_symbol + (Random Symbol) (random.and ..random_text ..random_text)) (implementation: location_equivalence @@ -104,7 +105,7 @@ random.rev random.safe_frac ..random_text - ..random_name + ..random_symbol random_sequence random_sequence random_sequence @@ -265,7 +266,7 @@ [/.maybe (/.maybe /.nat) format.maybe (format.maybe format.nat) (random.maybe random.nat) (maybe.equivalence n.equivalence)] [/.list (/.list /.nat) format.list (format.list format.nat) (random.list ..segment_size random.nat) (list.equivalence n.equivalence)] [/.set (/.set n.hash /.nat) format.set (format.set format.nat) (random.set n.hash ..segment_size random.nat) set.equivalence] - [/.name /.name format.name format.name ..random_name name.equivalence])) + [/.symbol /.symbol format.symbol format.symbol ..random_symbol symbol.equivalence])) (do [! random.monad] [expected (# ! each (list.repeated ..segment_size) random.nat)] (_.cover [/.set_elements_are_not_unique] diff --git a/stdlib/source/test/lux/control/parser/code.lux b/stdlib/source/test/lux/control/parser/code.lux index 70afee9b7..aee053104 100644 --- a/stdlib/source/test/lux/control/parser/code.lux +++ b/stdlib/source/test/lux/control/parser/code.lux @@ -10,7 +10,6 @@ ["<>" parser]] [data ["[0]" bit] - ["[0]" name] ["[0]" text] [collection ["[0]" list]]] @@ -22,7 +21,9 @@ ["[0]" nat] ["[0]" int] ["[0]" rev] - ["[0]" frac]]]]] + ["[0]" frac]]] + [meta + ["[0]" symbol]]]] [\\library ["[0]" /]]) @@ -34,8 +35,8 @@ _ false)]) -(def: random_name - (Random Name) +(def: random_symbol + (Random Symbol) (random.and (random.unicode 1) (random.unicode 1))) @@ -74,7 +75,7 @@ [/.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_name code.identifier name.equivalence] + [/.identifier /.identifier! ..random_symbol code.identifier symbol.equivalence] [/.local_identifier /.local_identifier! (random.unicode 1) code.local_identifier text.equivalence] )) (~~ (template [<query> <code>] diff --git a/stdlib/source/test/lux/control/parser/synthesis.lux b/stdlib/source/test/lux/control/parser/synthesis.lux index f82b020a9..aa7cc05ef 100644 --- a/stdlib/source/test/lux/control/parser/synthesis.lux +++ b/stdlib/source/test/lux/control/parser/synthesis.lux @@ -11,7 +11,6 @@ ["[0]" exception]] [data ["[0]" bit] - ["[0]" name] ["[0]" text] [collection ["[0]" list ("[1]#[0]" functor)]]] @@ -21,6 +20,8 @@ ["n" nat] ["[0]" i64] ["[0]" frac]]] + [meta + ["[0]" symbol]] [tool [compiler [reference {"+" } @@ -41,7 +42,7 @@ false)]) (def: random_constant - (Random Name) + (Random Symbol) (random.and (random.unicode 1) (random.unicode 1))) @@ -84,7 +85,7 @@ [/.text /.text! (random.unicode 1) synthesis.text text.equivalence] [/.local /.local! random.nat synthesis.variable/local n.equivalence] [/.foreign /.foreign! random.nat synthesis.variable/foreign n.equivalence] - [/.constant /.constant! ..random_constant synthesis.constant name.equivalence] + [/.constant /.constant! ..random_constant synthesis.constant symbol.equivalence] )) ))) diff --git a/stdlib/source/test/lux/control/parser/type.lux b/stdlib/source/test/lux/control/parser/type.lux index 2fca448f8..9ab2fb674 100644 --- a/stdlib/source/test/lux/control/parser/type.lux +++ b/stdlib/source/test/lux/control/parser/type.lux @@ -8,13 +8,14 @@ ["[0]" try] ["[0]" exception]] [data - ["[0]" name ("[1]#[0]" equivalence)] [collection ["[0]" list]]] [math ["[0]" random {"+" Random}] [number ["n" nat]]] + [meta + ["[0]" symbol ("[1]#[0]" equivalence)]] ["[0]" type ("[1]#[0]" equivalence)]]] [\\library ["[0]" / @@ -260,7 +261,7 @@ (|> (/.result /.named {.#Named expected_name expected_type}) (!expect (^multi {try.#Success [actual_name actual_type]} - (and (name#= expected_name actual_name) + (and (symbol#= expected_name actual_name) (type#= expected_type actual_type))))))) ..aggregate ..matches diff --git a/stdlib/source/test/lux/control/parser/xml.lux b/stdlib/source/test/lux/control/parser/xml.lux index 705b5cd27..0b246f995 100644 --- a/stdlib/source/test/lux/control/parser/xml.lux +++ b/stdlib/source/test/lux/control/parser/xml.lux @@ -10,7 +10,6 @@ ["[0]" exception]] [data ["[0]" text ("[1]#[0]" equivalence)] - ["[0]" name ("[1]#[0]" equivalence)] [format ["[0]" xml ("[1]#[0]" equivalence)]] [collection @@ -21,7 +20,9 @@ [math ["[0]" random {"+" Random}] [number - ["n" nat]]]]] + ["n" nat]]] + [meta + ["[0]" symbol ("[1]#[0]" equivalence)]]]] [\\library ["[0]" / ["/[1]" // ("[1]#[0]" monad)]]]) @@ -47,7 +48,7 @@ <<cases>>)))))))]) (def: random_label - (Random Name) + (Random Symbol) (random.and (random.ascii/alpha 1) (random.ascii/alpha 1))) @@ -80,18 +81,18 @@ (|> (/.result (do //.monad [actual /.tag _ /.any] - (in (name#= expected actual))) - (list {xml.#Node expected (dictionary.empty name.hash) (list)})) + (in (symbol#= expected actual))) + (list {xml.#Node expected (dictionary.empty symbol.hash) (list)})) (!expect {try.#Success #1})))) (do [! random.monad] [expected ..random_tag] (_.cover [/.node] (|> (/.result (/.node expected (//#in [])) - (list {xml.#Node expected (dictionary.empty name.hash) (list)})) + (list {xml.#Node expected (dictionary.empty symbol.hash) (list)})) (!expect {try.#Success []})))) (!failure /.wrong_tag [[(/.node ["" expected] (//#in [])) - {xml.#Node [expected ""] (dictionary.empty name.hash) (list)}]]) + {xml.#Node [expected ""] (dictionary.empty symbol.hash) (list)}]]) (do [! random.monad] [expected_tag ..random_tag expected_attribute ..random_attribute @@ -101,14 +102,14 @@ (//.after (/.attribute expected_attribute)) (//#in [])) (list {xml.#Node expected_tag - (|> (dictionary.empty name.hash) + (|> (dictionary.empty symbol.hash) (dictionary.has expected_attribute expected_value)) (list)})) (!expect {try.#Success []})))) (!failure /.unknown_attribute [[(/.attribute ["" expected]) {xml.#Node [expected expected] - (|> (dictionary.empty name.hash) + (|> (dictionary.empty symbol.hash) (dictionary.has [expected ""] expected)) (list)}]]) (!failure /.empty_input @@ -125,19 +126,19 @@ (/.node [expected expected] (//#in []))) {xml.#Node [expected expected] - (dictionary.empty name.hash) + (dictionary.empty symbol.hash) (list)}] [(do //.monad [_ /.any] (/.node [expected expected] (/.attribute [expected expected]))) {xml.#Node [expected expected] - (|> (dictionary.empty name.hash) + (|> (dictionary.empty symbol.hash) (dictionary.has [expected expected] expected)) (list)}]]) (!failure /.unexpected_input [[/.text - {xml.#Node [expected expected] (dictionary.empty name.hash) (list)}] + {xml.#Node [expected expected] (dictionary.empty symbol.hash) (list)}] [(/.node [expected expected] (//#in [])) {xml.#Text expected}] @@ -147,10 +148,10 @@ (do [! random.monad] [.let [node (: (-> xml.Tag (List xml.XML) xml.XML) (function (_ tag children) - {xml.#Node tag (dictionary.empty name.hash) children}))] + {xml.#Node tag (dictionary.empty symbol.hash) children}))] parent ..random_tag right ..random_tag - wrong (random.only (|>> (name#= right) not) + wrong (random.only (|>> (symbol#= right) not) ..random_tag) .let [parser (<| (/.node parent) (do //.monad |