diff options
Diffstat (limited to 'stdlib/source/parser')
-rw-r--r-- | stdlib/source/parser/lux/meta/compiler/language/lux/analysis.lux | 23 | ||||
-rw-r--r-- | stdlib/source/parser/lux/meta/compiler/language/lux/synthesis.lux | 10 |
2 files changed, 18 insertions, 15 deletions
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 1a32701c5..dec8032ed 100644 --- a/stdlib/source/parser/lux/meta/compiler/language/lux/analysis.lux +++ b/stdlib/source/parser/lux/meta/compiler/language/lux/analysis.lux @@ -53,14 +53,14 @@ (def .public (result parser input) (All (_ a) (-> (Parser a) (List Analysis) (Try a))) (when (parser input) - {try.#Failure error} - {try.#Failure error} - {try.#Success [{.#End} value]} {try.#Success value} {try.#Success [unconsumed _]} - (exception.except ..unconsumed_input unconsumed))) + (exception.except ..unconsumed_input unconsumed) + + {try.#Failure error} + {try.#Failure error})) (def .public any (Parser Analysis) @@ -76,9 +76,12 @@ (Parser Any) (function (_ tokens) (when tokens - {.#End} {try.#Success [tokens []]} - _ {try.#Failure (format "Expected list of tokens to be empty!" - (remaining_inputs tokens))}))) + {.#End} + {try.#Success [tokens []]} + + _ + {try.#Failure (format "Expected list of tokens to be empty!" + (remaining_inputs tokens))}))) (def .public end? (Parser Bit) @@ -92,7 +95,7 @@ (Parser <type>) (function (_ input) (when input - (list.partial (<tag> x) input') + (list.partial (<tag> @ x) input') {try.#Success [input' x]} _ @@ -102,7 +105,7 @@ (-> <type> (Parser Any)) (function (_ input) (when input - (list.partial (<tag> actual) input') + (list.partial (<tag> @ actual) input') (if (at <eq> = expected actual) {try.#Success [input' []]} (exception.except ..cannot_parse input)) @@ -125,7 +128,7 @@ (All (_ a) (-> (Parser a) (Parser a))) (function (_ input) (when input - (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/meta/compiler/language/lux/synthesis.lux b/stdlib/source/parser/lux/meta/compiler/language/lux/synthesis.lux index 66b41582e..e1d740d92 100644 --- a/stdlib/source/parser/lux/meta/compiler/language/lux/synthesis.lux +++ b/stdlib/source/parser/lux/meta/compiler/language/lux/synthesis.lux @@ -93,7 +93,7 @@ (Parser <type>) (.function (_ input) (when input - (list.partial (<tag> x) input') + (list.partial (<tag> @ x) input') {try.#Success [input' x]} _ @@ -103,7 +103,7 @@ (-> <type> (Parser Any)) (.function (_ input) (when input - (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) (when input - (list.partial (/.tuple head) tail) + (list.partial (/.tuple @ head) tail) (do try.monad [output (..result parser head)] {try.#Success [tail output]}) @@ -136,7 +136,7 @@ (All (_ a) (-> Arity (Parser a) (Parser [(Environment Synthesis) a]))) (.function (_ input) (when input - (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))] @@ -150,7 +150,7 @@ (All (_ a b) (-> (Parser a) (Parser b) (Parser [Register a b]))) (.function (_ input) (when input - (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))] |