aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/data/format/tar.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/data/format/tar.lux54
1 files changed, 27 insertions, 27 deletions
diff --git a/stdlib/source/library/lux/data/format/tar.lux b/stdlib/source/library/lux/data/format/tar.lux
index d216a1ef8..d5dad8d9b 100644
--- a/stdlib/source/library/lux/data/format/tar.lux
+++ b/stdlib/source/library/lux/data/format/tar.lux
@@ -8,7 +8,7 @@
["." try (#+ Try)]
["." exception (#+ exception:)]
["<>" parser
- ["<b>" binary (#+ Parser)]]]
+ ["<.>" binary (#+ Parser)]]]
[data
["." product]
["." binary (#+ Binary)]
@@ -100,11 +100,11 @@
[not_a_small_number small_limit ..small_size
Small small from_small
small_writer (format ..blank ..null)
- coerce_small]
+ as_small]
[not_a_big_number big_limit ..big_size
Big big from_big
big_writer ..blank
- coerce_big]
+ as_big]
)
(exception: #export (wrong_character {expected Char} {actual Char})
@@ -115,8 +115,8 @@
(def: verify_small_suffix
(Parser Any)
(do <>.monad
- [pre_end <b>.bits/8
- end <b>.bits/8
+ [pre_end <binary>.bits/8
+ end <binary>.bits/8
_ (let [expected (`` (char (~~ (static ..blank))))]
(<>.assert (exception.construct ..wrong_character [expected pre_end])
(n.= expected pre_end)))
@@ -128,7 +128,7 @@
(def: small_parser
(Parser Small)
(do <>.monad
- [digits (<b>.segment ..small_size)
+ [digits (<binary>.segment ..small_size)
digits (<>.lift (\ utf8.codec decode digits))
_ ..verify_small_suffix]
(<>.lift
@@ -139,9 +139,9 @@
(def: big_parser
(Parser Big)
(do <>.monad
- [digits (<b>.segment ..big_size)
+ [digits (<binary>.segment ..big_size)
digits (<>.lift (\ utf8.codec decode digits))
- end <b>.bits/8
+ end <binary>.bits/8
_ (let [expected (`` (char (~~ (static ..blank))))]
(<>.assert (exception.construct ..wrong_character [expected end])
(n.= expected end)))]
@@ -177,7 +177,7 @@
(def: checksum_code
(-> Binary Checksum)
(|>> ..checksum
- ..coerce_small
+ ..as_small
..from_small
(\ n.octal encode)
(..octal_padding ..small_size)
@@ -195,7 +195,7 @@
(def: checksum_parser
(Parser [Nat Checksum])
(do <>.monad
- [ascii (<b>.segment ..small_size)
+ [ascii (<binary>.segment ..small_size)
digits (<>.lift (\ utf8.codec decode ascii))
_ ..verify_small_suffix
value (<>.lift
@@ -273,8 +273,8 @@
(def: <parser>
(Parser <type>)
(do <>.monad
- [string (<b>.segment <size>)
- end <b>.bits/8
+ [string (<binary>.segment <size>)
+ end <binary>.bits/8
#let [expected (`` (char (~~ (static ..null))))]
_ (<>.assert (exception.construct ..wrong_character [expected end])
(n.= expected end))]
@@ -315,8 +315,8 @@
(def: magic_parser
(Parser Magic)
(do <>.monad
- [string (<b>.segment ..magic_size)
- end <b>.bits/8
+ [string (<binary>.segment ..magic_size)
+ end <binary>.bits/8
#let [expected (`` (char (~~ (static ..null))))]
_ (<>.assert (exception.construct ..wrong_character [expected end])
(n.= expected end))]
@@ -417,7 +417,7 @@
(def: link_flag_parser
(Parser Link_Flag)
(do <>.monad
- [linkflag <b>.bits/8]
+ [linkflag <binary>.bits/8]
(case (.nat linkflag)
(^template [<value> <link_flag>]
[(^ <value>)
@@ -540,7 +540,7 @@
(def: #export no_id
ID
- (..coerce_small 0))
+ (..as_small 0))
(type: #export Owner
{#name Name
@@ -638,7 +638,7 @@
(|>> instant.relative
(duration.query duration.second)
.nat
- ..coerce_big))
+ ..as_big))
(def: (file_writer link_flag)
(-> Link_Flag (Writer File))
@@ -678,8 +678,8 @@
#mode ..none
#user_id ..no_id
#group_id ..no_id
- #size (..coerce_big 0)
- #modification_time (..coerce_big 0)
+ #size (..as_big 0)
+ #modification_time (..as_big 0)
#checksum ..dummy_checksum
#link_flag ..symbolic_link
#link_name path
@@ -696,8 +696,8 @@
#mode ..none
#user_id ..no_id
#group_id ..no_id
- #size (..coerce_big 0)
- #modification_time (..coerce_big 0)
+ #size (..as_big 0)
+ #modification_time (..as_big 0)
#checksum ..dummy_checksum
#link_flag ..directory
#link_name ..no_path
@@ -753,7 +753,7 @@
(def: header_parser
(Parser Header)
(do <>.monad
- [binary_header (<>.speculative (<b>.segment block_size))
+ [binary_header (<>.speculative (<binary>.segment block_size))
path ..path_parser
mode ..mode_parser
user_id ..small_parser
@@ -772,7 +772,7 @@
group_name ..name_parser
major_device ..small_parser
minor_device ..small_parser
- _ (<b>.segment ..header_padding_size)]
+ _ (<binary>.segment ..header_padding_size)]
(in {#path path
#mode mode
#user_id user_id
@@ -801,9 +801,9 @@
(is? expected (get@ #link_flag header)))
#let [size (get@ #size header)
rounded_size (..rounded_content_size size)]
- content (<b>.segment (..from_big size))
+ content (<binary>.segment (..from_big size))
content (<>.lift (..content content))
- _ (<b>.segment (n.- (..from_big size) rounded_size))]
+ _ (<binary>.segment (n.- (..from_big size) rounded_size))]
(in [(get@ #path header)
(|> header
(get@ #modification_time)
@@ -847,7 +847,7 @@
(def: end_of_archive_block_parser
(Parser Any)
(do <>.monad
- [block (<b>.segment ..block_size)]
+ [block (<binary>.segment ..block_size)]
(let [actual (..checksum block)]
(<>.lift
(exception.assert ..wrong_checksum [0 actual]
@@ -859,7 +859,7 @@
(Parser Any)
(do <>.monad
[_ (<>.at_most 2 end_of_archive_block_parser)
- done? <b>.end?]
+ done? <binary>.end?]
(<>.lift
(exception.assert ..invalid_end_of_archive []
done?))))