diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/control/parser/binary.lux | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/stdlib/source/lux/control/parser/binary.lux b/stdlib/source/lux/control/parser/binary.lux index 03bcc9eba..32750d535 100644 --- a/stdlib/source/lux/control/parser/binary.lux +++ b/stdlib/source/lux/control/parser/binary.lux @@ -28,10 +28,10 @@ (type: #export Parser (//.Parser [Offset Binary])) -(exception: #export (binary-was-not-fully-read {binary-length Nat} {bytes-read Nat}) +(exception: #export (binary_was_not_fully_read {binary_length Nat} {bytes_read Nat}) (exception.report - ["Binary length" (%.nat binary-length)] - ["Bytes read" (%.nat bytes-read)])) + ["Binary length" (%.nat binary_length)] + ["Bytes read" (%.nat bytes_read)])) (def: #export (run parser input) (All [a] (-> (Parser a) Binary (Try a))) @@ -43,7 +43,7 @@ (let [length (/.size input)] (if (n.= end length) (#try.Success output) - (exception.throw ..binary-was-not-fully-read [length end]))))) + (exception.throw ..binary_was_not_fully_read [length end]))))) (def: #export end? (Parser Bit) @@ -94,9 +94,9 @@ (def: #export frac (Parser Frac) - (//\map frac.from-bits ..bits/64)) + (//\map frac.from_bits ..bits/64)) -(exception: #export (invalid-tag {range Nat} {byte Nat}) +(exception: #export (invalid_tag {range Nat} {byte Nat}) (exception.report ["Tag range" (%.nat range)] ["Tag value" (%.nat byte)])) @@ -109,7 +109,7 @@ (^template [<number> <tag> <parser>] [<number> (\ ! map (|>> <tag>) <parser>)]) ((~~ (template.splice <case>+))) - _ (//.lift (exception.throw ..invalid-tag [(~~ (template.count <case>+)) flag])))))) + _ (//.lift (exception.throw ..invalid_tag [(~~ (template.count <case>+)) flag])))))) (def: #export (or left right) (All [l r] (-> (Parser l) (Parser r) (Parser (| l r)))) @@ -126,7 +126,7 @@ (Parser Any) (//\wrap [])) -(exception: #export (not-a-bit {value Nat}) +(exception: #export (not_a_bit {value Nat}) (exception.report ["Expected values" "either 0 or 1"] ["Actual value" (%.nat value)])) @@ -139,7 +139,7 @@ (case value 0 (wrap #0) 1 (wrap #1) - _ (//.lift (exception.throw ..not-a-bit [value]))))) + _ (//.lift (exception.throw ..not_a_bit [value]))))) (def: #export (segment size) (-> Nat (Parser Binary)) @@ -214,14 +214,14 @@ (|>> (//.and value) (..or ..any)))) -(exception: #export set-elements-are-not-unique) +(exception: #export set_elements_are_not_unique) (def: #export (set hash value) (All [a] (-> (Hash a) (Parser a) (Parser (Set a)))) (do //.monad [raw (..list value) - #let [output (set.from-list hash raw)] - _ (//.assert (exception.construct ..set-elements-are-not-unique []) + #let [output (set.from_list hash raw)] + _ (//.assert (exception.construct ..set_elements_are_not_unique []) (n.= (list.size raw) (set.size output)))] (wrap output))) |