From 94e5802f594a73245fce0fbd885103b8bf210d57 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 2 Dec 2022 19:33:00 -0400 Subject: Added some simple time-series handling machinery. --- stdlib/source/parser/lux/data/binary.lux | 4 ++-- stdlib/source/parser/lux/data/format/json.lux | 4 ++-- stdlib/source/parser/lux/data/format/xml.lux | 2 +- stdlib/source/parser/lux/data/text.lux | 6 +++--- stdlib/source/parser/lux/meta/code.lux | 6 +++--- stdlib/source/parser/lux/meta/compiler/language/lux/analysis.lux | 2 +- stdlib/source/parser/lux/meta/compiler/language/lux/synthesis.lux | 2 +- stdlib/source/parser/lux/meta/type.lux | 2 +- stdlib/source/parser/lux/world/environment.lux | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-) (limited to 'stdlib/source/parser') diff --git a/stdlib/source/parser/lux/data/binary.lux b/stdlib/source/parser/lux/data/binary.lux index 2aad65ba1..90b521d6a 100644 --- a/stdlib/source/parser/lux/data/binary.lux +++ b/stdlib/source/parser/lux/data/binary.lux @@ -139,7 +139,7 @@ (with_expansions [+' (template.spliced +)] (when flag (^.with_template [ ] - [ (`` (at ! each (|>> {(,, (template.spliced ))}) ))]) + [ (`` (of ! each (|>> {(,, (template.spliced ))}) ))]) (+') _ (//.of_try (exception.except ..invalid_tag [(template.amount [+]) flag])))))])) @@ -206,7 +206,7 @@ (Parser Text) (do //.monad [utf8 ] - (//.of_try (at utf8.codec decoded utf8)))))] + (//.of_try (of utf8.codec decoded utf8)))))] [08 utf8_8 ..binary_8] [16 utf8_16 ..binary_16] diff --git a/stdlib/source/parser/lux/data/format/json.lux b/stdlib/source/parser/lux/data/format/json.lux index aff96d9b7..a4c0fb532 100644 --- a/stdlib/source/parser/lux/data/format/json.lux +++ b/stdlib/source/parser/lux/data/format/json.lux @@ -92,7 +92,7 @@ [head ..any] (when head { value} - (in (at = test value)) + (in (of = test value)) _ (//.failure (exception.error ..unexpected_value [head]))))) @@ -103,7 +103,7 @@ [head ..any] (when head { value} - (if (at = test value) + (if (of = test value) (in []) (//.failure (exception.error ..value_mismatch [{ test} { value}]))) diff --git a/stdlib/source/parser/lux/data/format/xml.lux b/stdlib/source/parser/lux/data/format/xml.lux index 603cfe6c5..4c64d8dab 100644 --- a/stdlib/source/parser/lux/data/format/xml.lux +++ b/stdlib/source/parser/lux/data/format/xml.lux @@ -39,7 +39,7 @@ (exception.def .public (unconsumed_inputs inputs) (Exception (List XML)) (exception.report - (list ["Inputs" (exception.listing (at /.codec encoded) inputs)]))) + (list ["Inputs" (exception.listing (of /.codec encoded) inputs)]))) (def (result' parser attrs documents) (All (_ a) (-> (Parser a) Attrs (List XML) (Try a))) diff --git a/stdlib/source/parser/lux/data/text.lux b/stdlib/source/parser/lux/data/text.lux index 0fe1fb3ec..6deb892f6 100644 --- a/stdlib/source/parser/lux/data/text.lux +++ b/stdlib/source/parser/lux/data/text.lux @@ -335,7 +335,7 @@ (with_template [ ] [(def .public ( parser) (-> (Parser Text) (Parser Text)) - (|> parser (at //.monad each /.together)))] + (|> parser (of //.monad each /.together)))] [some //.some "some"] [many //.many "many"] @@ -355,7 +355,7 @@ (-> Nat (Parser Text) (Parser Text)) (|> parser ( amount) - (at //.monad each /.together)))] + (of //.monad each /.together)))] [exactly //.exactly "exactly"] [at_most //.at_most "at most"] @@ -377,7 +377,7 @@ (-> Nat Nat (Parser Text) (Parser Text)) (|> parser (//.between minimum additional) - (at //.monad each /.together))) + (of //.monad each /.together))) (def .public (between! minimum additional parser) (-> Nat Nat (Parser Slice) (Parser Slice)) diff --git a/stdlib/source/parser/lux/meta/code.lux b/stdlib/source/parser/lux/meta/code.lux index b0a23eb8c..3ca27bb84 100644 --- a/stdlib/source/parser/lux/meta/code.lux +++ b/stdlib/source/parser/lux/meta/code.lux @@ -76,7 +76,7 @@ (function (_ tokens) (when tokens {.#Item [[_ { actual}] tokens']} - (if (at = expected actual) + (if (of = expected actual) {try.#Success [tokens' []]} ) @@ -121,7 +121,7 @@ (function (_ tokens) (when tokens {.#Item [[_ {.#Symbol ["" actual]}] tokens']} - (if (at text.equivalence = expected actual) + (if (of text.equivalence = expected actual) {try.#Success [tokens' []]} ) @@ -150,7 +150,7 @@ {.#Item [[_ {.#Symbol it}] tokens']} - (if (at symbol.equivalence = expected it) + (if (of symbol.equivalence = expected it) {try.#Success [tokens' []]} ) diff --git a/stdlib/source/parser/lux/meta/compiler/language/lux/analysis.lux b/stdlib/source/parser/lux/meta/compiler/language/lux/analysis.lux index dec8032ed..566ec7c58 100644 --- a/stdlib/source/parser/lux/meta/compiler/language/lux/analysis.lux +++ b/stdlib/source/parser/lux/meta/compiler/language/lux/analysis.lux @@ -106,7 +106,7 @@ (function (_ input) (when input (list.partial ( @ actual) input') - (if (at = expected actual) + (if (of = expected actual) {try.#Success [input' []]} (exception.except ..cannot_parse input)) diff --git a/stdlib/source/parser/lux/meta/compiler/language/lux/synthesis.lux b/stdlib/source/parser/lux/meta/compiler/language/lux/synthesis.lux index e1d740d92..1ea72a289 100644 --- a/stdlib/source/parser/lux/meta/compiler/language/lux/synthesis.lux +++ b/stdlib/source/parser/lux/meta/compiler/language/lux/synthesis.lux @@ -104,7 +104,7 @@ (.function (_ input) (when input (list.partial ( @ actual) input') - (if (at = expected actual) + (if (of = expected actual) {try.#Success [input' []]} (exception.except ..cannot_parse input)) diff --git a/stdlib/source/parser/lux/meta/type.lux b/stdlib/source/parser/lux/meta/type.lux index f84ab2452..55eea02ea 100644 --- a/stdlib/source/parser/lux/meta/type.lux +++ b/stdlib/source/parser/lux/meta/type.lux @@ -185,7 +185,7 @@ (All (_ a) (-> (Parser a) (Parser [Code (List Code) a]))) (do [! //.monad] [headT any - funcI (at ! each dictionary.size ..env) + funcI (of ! each dictionary.size ..env) [num_args non_poly] (local (list headT) ..polymorphic') env ..env .let [funcL (label funcI) diff --git a/stdlib/source/parser/lux/world/environment.lux b/stdlib/source/parser/lux/world/environment.lux index 3b8a3049b..59bc6f254 100644 --- a/stdlib/source/parser/lux/world/environment.lux +++ b/stdlib/source/parser/lux/world/environment.lux @@ -42,4 +42,4 @@ (def .public (result parser environment) (All (_ a) (-> (Parser a) Environment (Try a))) - (at try.monad each product.right (parser environment))) + (of try.monad each product.right (parser environment))) -- cgit v1.2.3