mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 08:38:14 +01:00
Tweak json decode_trailer whitespace_length var
This commit is contained in:
1 parent
ad46513ded
commit
b374b2b34f
2 files changed
+2
-12
No files matched your search
@@ -1688,10 +1688,10 @@ pri func decoder.decode_trailer?(dst: base.token_writer, src: base.io_reader) {
|
||||
while.outer true {
|
||||
if args.dst.length() <= 0 {
|
||||
yield? base."$short write"
|
||||
whitespace_length = 0
|
||||
continue.outer
|
||||
}
|
||||
|
||||
whitespace_length = 0
|
||||
while.inner true,
|
||||
pre args.dst.length() > 0,
|
||||
{
|
||||
@@ -1699,13 +1699,11 @@ pri func decoder.decode_trailer?(dst: base.token_writer, src: base.io_reader) {
|
||||
if whitespace_length > 0 {
|
||||
args.dst.write_simple_token_fast!(
|
||||
value_major: 0, value_minor: 0, continued: 0, length: whitespace_length)
|
||||
whitespace_length = 0
|
||||
}
|
||||
if args.src.is_closed() {
|
||||
break.outer
|
||||
}
|
||||
yield? base."$short read"
|
||||
whitespace_length = 0
|
||||
continue.outer
|
||||
}
|
||||
|
||||
@@ -1714,14 +1712,12 @@ pri func decoder.decode_trailer?(dst: base.token_writer, src: base.io_reader) {
|
||||
if whitespace_length > 0 {
|
||||
args.dst.write_simple_token_fast!(
|
||||
value_major: 0, value_minor: 0, continued: 0, length: whitespace_length)
|
||||
whitespace_length = 0
|
||||
}
|
||||
if this.trailer_stop > 0 {
|
||||
return "#bad input"
|
||||
}
|
||||
this.decode_comment?(dst: args.dst, src: args.src)
|
||||
c = 0
|
||||
whitespace_length = 0
|
||||
if this.comment_type > 0 {
|
||||
continue.outer
|
||||
}
|
||||
@@ -1732,7 +1728,6 @@ pri func decoder.decode_trailer?(dst: base.token_writer, src: base.io_reader) {
|
||||
if (whitespace_length >= 0xFFFE) or (c == this.trailer_stop) {
|
||||
args.dst.write_simple_token_fast!(
|
||||
value_major: 0, value_minor: 0, continued: 0, length: whitespace_length + 1)
|
||||
whitespace_length = 0
|
||||
if c == this.trailer_stop {
|
||||
return ok
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user