diff options
author | Eduardo Julian | 2022-07-03 00:35:32 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-07-03 00:35:32 -0400 |
commit | 9e7ddacf853efd7a18c1911d2f287d483b083229 (patch) | |
tree | 140eee091b7453879f072a48044635d03aa5096b /stdlib/source/parser | |
parent | 7e4c9ba2e02f06fa621ffe24bc0ca046536429ef (diff) |
Added a new custom type for pattern-matching macros.
Diffstat (limited to '')
4 files changed, 11 insertions, 11 deletions
diff --git a/stdlib/source/parser/lux/data/format/json.lux b/stdlib/source/parser/lux/data/format/json.lux index ddb73da8f..c125d79d1 100644 --- a/stdlib/source/parser/lux/data/format/json.lux +++ b/stdlib/source/parser/lux/data/format/json.lux @@ -169,7 +169,7 @@ (All (_ a) (-> Text (Parser a) (Parser a))) (function (again inputs) (case inputs - (pattern (list.partial {/.#String key} value inputs')) + (list.partial {/.#String key} value inputs') (if (text#= key field_name) (case (//.result parser (list value)) {try.#Success [{.#End} output]} diff --git a/stdlib/source/parser/lux/meta/type.lux b/stdlib/source/parser/lux/meta/type.lux index 2b03a75e1..6f31848ae 100644 --- a/stdlib/source/parser/lux/meta/type.lux +++ b/stdlib/source/parser/lux/meta/type.lux @@ -314,7 +314,7 @@ (do [! //.monad] [headT any] (case (/.anonymous headT) - (pattern {.#Apply (|recursion_dummy|) {.#UnivQ _ headT'}}) + {.#Apply (|recursion_dummy|) {.#UnivQ _ headT'}} (do ! [[recT _ output] (|> poly (with_extension (|recursion_dummy|)) @@ -331,7 +331,7 @@ [env ..env headT any] (case (/.anonymous headT) - (^.multi (pattern {.#Apply (|recursion_dummy|) {.#Parameter funcT_idx}}) + (^.multi {.#Apply (|recursion_dummy|) {.#Parameter funcT_idx}} (n.= 0 (..argument env funcT_idx)) [(dictionary.value 0 env) {.#Some [self_type self_call]}]) (in self_call) diff --git a/stdlib/source/parser/lux/tool/compiler/language/lux/analysis.lux b/stdlib/source/parser/lux/tool/compiler/language/lux/analysis.lux index 7c7e8b855..5e818aa29 100644 --- a/stdlib/source/parser/lux/tool/compiler/language/lux/analysis.lux +++ b/stdlib/source/parser/lux/tool/compiler/language/lux/analysis.lux @@ -91,7 +91,7 @@ (Parser <type>) (function (_ input) (case input - (pattern (list.partial (<tag> x) input')) + (list.partial (<tag> x) input') {try.#Success [input' x]} _ @@ -101,7 +101,7 @@ (-> <type> (Parser Any)) (function (_ input) (case input - (pattern (list.partial (<tag> actual) input')) + (list.partial (<tag> actual) input') (if (at <eq> = expected actual) {try.#Success [input' []]} (exception.except ..cannot_parse input)) @@ -124,7 +124,7 @@ (All (_ a) (-> (Parser a) (Parser a))) (function (_ input) (case input - (pattern (list.partial (/.tuple head) tail)) + (list.partial (/.tuple head) tail) (do try.monad [output (..result parser head)] {try.#Success [tail output]}) diff --git a/stdlib/source/parser/lux/tool/compiler/language/lux/synthesis.lux b/stdlib/source/parser/lux/tool/compiler/language/lux/synthesis.lux index de0c5d1ac..2117dabd0 100644 --- a/stdlib/source/parser/lux/tool/compiler/language/lux/synthesis.lux +++ b/stdlib/source/parser/lux/tool/compiler/language/lux/synthesis.lux @@ -95,7 +95,7 @@ (Parser <type>) (.function (_ input) (case input - (pattern (list.partial (<tag> x) input')) + (list.partial (<tag> x) input') {try.#Success [input' x]} _ @@ -105,7 +105,7 @@ (-> <type> (Parser Any)) (.function (_ input) (case input - (pattern (list.partial (<tag> actual) input')) + (list.partial (<tag> actual) input') (if (at <eq> = expected actual) {try.#Success [input' []]} (exception.except ..cannot_parse input)) @@ -126,7 +126,7 @@ (All (_ a) (-> (Parser a) (Parser a))) (.function (_ input) (case input - (pattern (list.partial (/.tuple head) tail)) + (list.partial (/.tuple head) tail) (do try.monad [output (..result parser head)] {try.#Success [tail output]}) @@ -138,7 +138,7 @@ (All (_ a) (-> Arity (Parser a) (Parser [(Environment Synthesis) a]))) (.function (_ input) (case input - (pattern (list.partial (/.function/abstraction [environment actual body]) tail)) + (list.partial (/.function/abstraction [environment actual body]) tail) (if (n.= expected actual) (do try.monad [output (..result parser (list body))] @@ -152,7 +152,7 @@ (All (_ a b) (-> (Parser a) (Parser b) (Parser [Register a b]))) (.function (_ input) (case input - (pattern (list.partial (/.loop/scope [start inits iteration]) tail)) + (list.partial (/.loop/scope [start inits iteration]) tail) (do try.monad [inits (..result init_parsers inits) iteration (..result iteration_parser (list iteration))] |