From 820ffc0a87d7960e62508fc451d9df7a94a6afa7 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 19 Oct 2022 19:34:33 -0400 Subject: Migrating default extensions to the new format [Part 2] --- stdlib/source/parser/lux/data/binary.lux | 6 +++--- stdlib/source/parser/lux/data/text.lux | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 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 2a1bf3304..3130b607a 100644 --- a/stdlib/source/parser/lux/data/binary.lux +++ b/stdlib/source/parser/lux/data/binary.lux @@ -49,9 +49,9 @@ (template ( ) [( )]))] - [n#= "lux i64 ="] - [n#+ "lux i64 +"] - [n#- "lux i64 -"] + [n#= .i64_=#] + [n#+ .i64_+#] + [n#- .i64_-#] ) (def .public (result parser input) diff --git a/stdlib/source/parser/lux/data/text.lux b/stdlib/source/parser/lux/data/text.lux index 50bb41cb3..dc2507cff 100644 --- a/stdlib/source/parser/lux/data/text.lux +++ b/stdlib/source/parser/lux/data/text.lux @@ -92,7 +92,7 @@ slices parser] (in (list#mix (function (_ [slice::basis slice::distance] [total::basis total::distance]) - [total::basis ("lux i64 +" slice::distance total::distance)]) + [total::basis (.i64_+# slice::distance total::distance)]) [#basis offset #distance 0] slices)))) @@ -102,7 +102,7 @@ (function (_ [offset tape]) (when (/.char offset tape) {.#Some output} - {try.#Success [[("lux i64 +" 1 offset) tape] (/.of_char output)]} + {try.#Success [[(.i64_+# 1 offset) tape] (/.of_char output)]} _ (exception.except ..cannot_parse [])))) @@ -112,7 +112,7 @@ (function (_ [offset tape]) (when (/.char offset tape) {.#Some _} - {try.#Success [[("lux i64 +" 1 offset) tape] + {try.#Success [[(.i64_+# 1 offset) tape] [#basis offset #distance 1]]} @@ -145,7 +145,7 @@ (when (/.index_since offset reference tape) {.#Some where} (if (n.= offset where) - {try.#Success [[("lux i64 +" (/.size reference) offset) tape] + {try.#Success [[(.i64_+# (/.size reference) offset) tape] []]} (exception.except ..cannot_match [reference])) @@ -249,7 +249,7 @@ {.#Some output} (let [output' (/.of_char output)] (if ( (/.contains? output' options)) - {try.#Success [[("lux i64 +" 1 offset) tape] output']} + {try.#Success [[(.i64_+# 1 offset) tape] output']} (exception.except [options output]))) _ @@ -267,7 +267,7 @@ {.#Some output} (let [output' (/.of_char output)] (if ( (/.contains? output' options)) - {try.#Success [[("lux i64 +" 1 offset) tape] + {try.#Success [[(.i64_+# 1 offset) tape] [#basis offset #distance 1]]} (exception.except [options output]))) @@ -290,7 +290,7 @@ (when (/.char offset tape) {.#Some output} (if (parser output) - {try.#Success [[("lux i64 +" 1 offset) tape] (/.of_char output)]} + {try.#Success [[(.i64_+# 1 offset) tape] (/.of_char output)]} (exception.except ..character_does_not_satisfy_predicate [output])) _ @@ -302,7 +302,7 @@ (when (/.char offset tape) {.#Some output} (if (parser output) - {try.#Success [[("lux i64 +" 1 offset) tape] + {try.#Success [[(.i64_+# 1 offset) tape] [#basis offset #distance 1]]} (exception.except ..character_does_not_satisfy_predicate [output])) @@ -329,7 +329,7 @@ (do //.monad [(open "left[0]") left (open "right[0]") right] - (in [left#basis ("lux i64 +" left#distance right#distance)]))) + (in [left#basis (.i64_+# left#distance right#distance)]))) (with_template [ ] [(def .public ( parser) -- cgit v1.2.3