diff options
Diffstat (limited to 'stdlib/source/lux/control/parser/text.lux')
-rw-r--r-- | stdlib/source/lux/control/parser/text.lux | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/stdlib/source/lux/control/parser/text.lux b/stdlib/source/lux/control/parser/text.lux index 0e57f02f6..bec295f39 100644 --- a/stdlib/source/lux/control/parser/text.lux +++ b/stdlib/source/lux/control/parser/text.lux @@ -10,7 +10,7 @@ ["." maybe] ["/" text ("#@." monoid)] [number - ["." nat ("#@." decimal)]] + ["n" nat ("#@." decimal)]] [collection ["." list ("#@." fold)]]] [macro @@ -34,13 +34,13 @@ (exception: #export (unconsumed-input {offset Offset} {tape Text}) (exception.report - ["Offset" (nat@encode offset)] - ["Input size" (nat@encode (/.size tape))] + ["Offset" (n@encode offset)] + ["Input size" (n@encode (/.size tape))] ["Remaining input" (remaining offset tape)])) (exception: #export (expected-to-fail {offset Offset} {tape Text}) (exception.report - ["Offset" (nat@encode offset)] + ["Offset" (n@encode offset)] ["Input" (remaining offset tape)])) (exception: #export cannot-parse) @@ -53,7 +53,7 @@ (#try.Failure msg) (#try.Success [[end-offset _] output]) - (if (n/= end-offset (/.size input)) + (if (n.= end-offset (/.size input)) (#try.Success output) (exception.throw ..unconsumed-input [end-offset input])))) @@ -115,7 +115,7 @@ (function (_ [offset tape]) (case (/.index-of' reference offset tape) (#.Some where) - (if (n/= offset where) + (if (n.= offset where) (#try.Success [[("lux i64 +" (/.size reference) offset) tape] []]) (#try.Failure ($_ /@compose "Could not match: " (/.encode reference) " @ " (maybe.assume (/.clip' offset tape))))) @@ -128,7 +128,7 @@ (-> Text (Parser Bit)) (function (_ (^@ input [offset tape])) (case (/.index-of' reference offset tape) - (^multi (#.Some where) (n/= offset where)) + (^multi (#.Some where) (n.= offset where)) (#try.Success [[("lux i64 +" (/.size reference) offset) tape] #1]) @@ -139,7 +139,7 @@ {#.doc "Ensure the parser's input is empty."} (Parser Any) (function (_ (^@ input [offset tape])) - (if (n/= offset (/.size tape)) + (if (n.= offset (/.size tape)) (#try.Success [input []]) (exception.throw ..unconsumed-input input)))) @@ -147,7 +147,7 @@ {#.doc "Ask if the parser's input is empty."} (Parser Bit) (function (_ (^@ input [offset tape])) - (#try.Success [input (n/= offset (/.size tape))]))) + (#try.Success [input (n.= offset (/.size tape))]))) (def: #export peek {#.doc "Lex the next character (without consuming it from the input)."} @@ -173,8 +173,8 @@ [char any #let [char' (maybe.assume (/.nth 0 char))] _ (//.assert ($_ /@compose "Character is not within range: " (/.from-code bottom) "-" (/.from-code top)) - (.and (n/>= bottom char') - (n/<= top char')))] + (.and (n.>= bottom char') + (n.<= top char')))] (wrap char))) (template [<name> <bottom> <top> <desc>] |