change currentOffset key name

main
Matthew Butterick 6 years ago
parent a0076963fd
commit b3b6bc386d

@ -29,7 +29,7 @@ https://github.com/mbutterick/restructure/blob/master/src/Array.coffee
(define new-parent (if (x:int? @len)
(mhasheq 'parent parent
x:start-offset-key (pos port)
'_currentOffset 0
x:current-offset-key 0
'_length @len)
parent))
(define len (resolve-length @len port parent))

@ -8,8 +8,9 @@
(define x:version-key 'x:version)
(define x:start-offset-key 'x:start-offset)
(define x:current-offset-key 'x:current-offset)
(define private-keys (list 'parent x:start-offset-key '_currentOffset '_length))
(define private-keys (list 'parent x:start-offset-key x:current-offset-key '_length))
(define (dict-ref* d . keys)
(for/fold ([d d])

@ -19,7 +19,7 @@ https://github.com/mbutterick/restructure/blob/master/src/LazyArray.coffee
(define new-parent (if (x:int? @len)
(mhasheq 'parent parent
x:start-offset-key starting-pos
'_currentOffset 0
x:current-offset-key 0
'_length @len)
parent))
(define stream-starting-pos (pos port))

@ -18,7 +18,7 @@ https://github.com/mbutterick/restructure/blob/master/src/Struct.coffee
(dict-set*! mheq
'parent parent
x:start-offset-key (pos port)
'_currentOffset 0
x:current-offset-key 0
'_length len)
mheq)
@ -33,7 +33,7 @@ https://github.com/mbutterick/restructure/blob/master/src/Struct.coffee
(send type x:decode port sdr)))
(unless (void? val)
(dict-set! sdr key val))
(dict-set! sdr '_currentOffset (- (pos port) (dict-ref sdr x:start-offset-key)))
(dict-set! sdr x:current-offset-key (- (pos port) (dict-ref sdr x:start-offset-key)))
sdr))
(define (dict->mutable-hash x)

Loading…
Cancel
Save