(out, olen, ol, code, state, usx_hcodes, usx_hcode_lens)
| 167 | } |
| 168 | |
| 169 | function append_code(out, olen, ol, code, state, usx_hcodes, usx_hcode_lens) { |
| 170 | var hcode = code >> 5; |
| 171 | var vcode = code & 0x1f; |
| 172 | if (usx_hcode_lens[hcode] == 0 && hcode != USX_ALPHA) return [ol, state]; |
| 173 | switch (hcode) { |
| 174 | case USX_ALPHA: |
| 175 | if (state != USX_ALPHA) { |
| 176 | ol = append_switch_code(out, olen, ol, state); |
| 177 | ol = append_bits( |
| 178 | out, |
| 179 | olen, |
| 180 | ol, |
| 181 | usx_hcodes[USX_ALPHA], |
| 182 | usx_hcode_lens[USX_ALPHA] |
| 183 | ); |
| 184 | state = USX_ALPHA; |
| 185 | } |
| 186 | break; |
| 187 | case USX_SYM: |
| 188 | ol = append_switch_code(out, olen, ol, state); |
| 189 | ol = append_bits( |
| 190 | out, |
| 191 | olen, |
| 192 | ol, |
| 193 | usx_hcodes[USX_SYM], |
| 194 | usx_hcode_lens[USX_SYM] |
| 195 | ); |
| 196 | break; |
| 197 | case USX_NUM: |
| 198 | if (state != USX_NUM) { |
| 199 | ol = append_switch_code(out, olen, ol, state); |
| 200 | ol = append_bits( |
| 201 | out, |
| 202 | olen, |
| 203 | ol, |
| 204 | usx_hcodes[USX_NUM], |
| 205 | usx_hcode_lens[USX_NUM] |
| 206 | ); |
| 207 | if ( |
| 208 | usx_sets[hcode].charCodeAt(vcode) >= 48 && |
| 209 | usx_sets[hcode].charCodeAt(vcode) <= 57 |
| 210 | ) |
| 211 | state = USX_NUM; |
| 212 | } |
| 213 | } |
| 214 | return [ |
| 215 | append_bits(out, olen, ol, usx_vcodes[vcode], usx_vcode_lens[vcode]), |
| 216 | state, |
| 217 | ]; |
| 218 | } |
| 219 | |
| 220 | const count_bit_lens = new Uint8Array([2, 4, 7, 11, 16]); |
| 221 | const count_adder = [4, 20, 148, 2196, 67732]; |
no test coverage detected