Rename [i..j] to [i ..= j], the same as Rust

This commit is contained in:
Nigel Tao committed 2019-10-12 18:40:53 +11:00
1 parent 18c6e5716a
commit d501daddc3
18 files changed
+219 -206

No files matched your search

+25 -25
View File
@@ -31,21 +31,21 @@ pub struct decoder?(
// set_literal_width. This is assigned to the literal_width field at the
// start of decode_io_writer. During that method, calling set_literal_width
// will change set_literal_width_arg but not literal_width.
set_literal_width_arg base.u32[..9],
set_literal_width_arg base.u32[..= 9],
// read_from state that does not change during a decode call.
literal_width base.u32[..8],
clear_code base.u32[..256],
end_code base.u32[..257],
literal_width base.u32[..= 8],
clear_code base.u32[..= 256],
end_code base.u32[..= 257],
// read_from state that does change during a decode call.
save_code base.u32[..4096],
prev_code base.u32[..4095],
width base.u32[..12],
save_code base.u32[..= 4096],
prev_code base.u32[..= 4095],
width base.u32[..= 12],
bits base.u32,
n_bits base.u32[..31],
output_ri base.u32[..8191],
output_wi base.u32[..8191],
n_bits base.u32[..= 31],
output_ri base.u32[..= 8191],
output_wi base.u32[..= 8191],
// read_from return value. The read_from method effectively returns a
// base.u32 to show how decode should continue after calling write_to. That
@@ -54,7 +54,7 @@ pub struct decoder?(
read_from_return_value base.u32,
// read_from per-code state.
prefixes array[4096] base.u16[..4095],
prefixes array[4096] base.u16[..= 4095],
util base.utility,
)(
@@ -69,7 +69,7 @@ pub struct decoder?(
output array[8192 + 7] base.u8,
)
pub func decoder.set_literal_width!(lw base.u32[..8]) {
pub func decoder.set_literal_width!(lw base.u32[..= 8]) {
this.set_literal_width_arg = args.lw + 1
}
@@ -78,7 +78,7 @@ pub func decoder.workbuf_len() base.range_ii_u64 {
}
pub func decoder.decode_io_writer?(dst base.io_writer, src base.io_reader, workbuf slice base.u8) {
var i base.u32[..8191]
var i base.u32[..= 8191]
// Initialize read_from state.
this.literal_width = 8
@@ -124,23 +124,23 @@ pub func decoder.decode_io_writer?(dst base.io_writer, src base.io_reader, workb
}
pri func decoder.read_from!(src base.io_reader) {
var clear_code base.u32[..256]
var end_code base.u32[..257]
var clear_code base.u32[..= 256]
var end_code base.u32[..= 257]
var save_code base.u32[..4096]
var prev_code base.u32[..4095]
var width base.u32[..12]
var save_code base.u32[..= 4096]
var prev_code base.u32[..= 4095]
var width base.u32[..= 12]
var bits base.u32
var n_bits base.u32[..31]
var output_wi base.u32[..8191]
var n_bits base.u32[..= 31]
var output_wi base.u32[..= 8191]
var code base.u32[..4095]
var c base.u32[..4095]
var o base.u32[..8191]
var code base.u32[..= 4095]
var c base.u32[..= 4095]
var o base.u32[..= 8191]
var steps base.u32
var first_byte base.u8
var lm1_b base.u16[..4095]
var lm1_a base.u16[..4095]
var lm1_b base.u16[..= 4095]
var lm1_a base.u16[..= 4095]
clear_code = this.clear_code
end_code = this.end_code