From 9e7ddacf853efd7a18c1911d2f287d483b083229 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 3 Jul 2022 00:35:32 -0400 Subject: Added a new custom type for pattern-matching macros. --- stdlib/source/parser/lux/data/format/json.lux | 2 +- stdlib/source/parser/lux/meta/type.lux | 4 ++-- .../source/parser/lux/tool/compiler/language/lux/analysis.lux | 6 +++--- .../source/parser/lux/tool/compiler/language/lux/synthesis.lux | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'stdlib/source/parser') 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 ) (function (_ input) (case input - (pattern (list.partial ( x) input')) + (list.partial ( x) input') {try.#Success [input' x]} _ @@ -101,7 +101,7 @@ (-> (Parser Any)) (function (_ input) (case input - (pattern (list.partial ( actual) input')) + (list.partial ( actual) input') (if (at = 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 ) (.function (_ input) (case input - (pattern (list.partial ( x) input')) + (list.partial ( x) input') {try.#Success [input' x]} _ @@ -105,7 +105,7 @@ (-> (Parser Any)) (.function (_ input) (case input - (pattern (list.partial ( actual) input')) + (list.partial ( actual) input') (if (at = 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))] -- cgit v1.2.3