1 // AUTOGENERATED FROM index-iso-8859-13.txt, ORIGINAL COMMENT FOLLOWS:
2 //
3 // Any copyright is dedicated to the Public Domain.
4 // https://creativecommons.org/publicdomain/zero/1.0/
5 //
6 // For details on index index-iso-8859-13.txt see the Encoding Standard
7 // https://encoding.spec.whatwg.org/
8 //
9 // Identifier: 40736338e964ab520407cebcb01329f8d450abf6ce12bf88b74b655b60e43300
10 // Date: 2014-12-19
11 
12 static FORWARD_TABLE: &'static [u16] = &[
13     128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
14     143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157,
15     158, 159, 160, 8221, 162, 163, 164, 8222, 166, 167, 216, 169, 342, 171,
16     172, 173, 174, 198, 176, 177, 178, 179, 8220, 181, 182, 183, 248, 185, 343,
17     187, 188, 189, 190, 230, 260, 302, 256, 262, 196, 197, 280, 274, 268, 201,
18     377, 278, 290, 310, 298, 315, 352, 323, 325, 211, 332, 213, 214, 215, 370,
19     321, 346, 362, 220, 379, 381, 223, 261, 303, 257, 263, 228, 229, 281, 275,
20     269, 233, 378, 279, 291, 311, 299, 316, 353, 324, 326, 243, 333, 245, 246,
21     247, 371, 322, 347, 363, 252, 380, 382, 8217,
22 ];
23 
24 /// Returns the index code point for pointer `code` in this index.
25 #[inline]
forward(code: u8) -> u1626 pub fn forward(code: u8) -> u16 {
27     FORWARD_TABLE[(code - 0x80) as usize]
28 }
29 
30 static BACKWARD_TABLE_LOWER: &'static [u8] = &[
31     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
32     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
33     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 129, 130, 131, 132, 133,
34     134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
35     149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 0, 162, 163,
36     164, 0, 166, 167, 0, 169, 0, 171, 172, 173, 174, 0, 176, 177, 178, 179, 0,
37     181, 182, 183, 0, 185, 0, 187, 188, 189, 190, 0, 0, 0, 0, 0, 196, 197, 175,
38     0, 0, 201, 0, 0, 0, 0, 0, 0, 0, 0, 0, 211, 0, 213, 214, 215, 168, 0, 0, 0,
39     220, 0, 0, 223, 0, 0, 0, 0, 228, 229, 191, 0, 0, 233, 0, 0, 0, 0, 0, 0, 0,
40     0, 0, 243, 0, 245, 246, 247, 184, 0, 0, 0, 252, 0, 0, 0, 194, 226, 0, 0,
41     192, 224, 195, 227, 0, 0, 0, 0, 200, 232, 0, 0, 0, 0, 199, 231, 0, 0, 203,
42     235, 198, 230, 0, 0, 0, 0, 0, 0, 0, 0, 204, 236, 0, 0, 0, 0, 0, 0, 206,
43     238, 0, 0, 193, 225, 0, 0, 0, 0, 0, 0, 205, 237, 0, 0, 0, 207, 239, 0, 0,
44     0, 0, 217, 249, 209, 241, 210, 242, 0, 0, 0, 0, 0, 212, 244, 0, 0, 0, 0, 0,
45     0, 0, 0, 170, 186, 0, 0, 218, 250, 0, 0, 0, 0, 208, 240, 0, 0, 0, 0, 0, 0,
46     0, 0, 219, 251, 0, 0, 0, 0, 0, 0, 216, 248, 0, 0, 0, 0, 0, 202, 234, 221,
47     253, 222, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
48     0, 0, 0, 0, 0, 0, 255, 0, 0, 180, 161, 165, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
49     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
50 ];
51 
52 static BACKWARD_TABLE_UPPER: &'static [u16] = &[
53     0, 0, 64, 128, 192, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
54     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
55     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
56     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
57     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
58     0, 0, 0, 0, 0, 320,
59 ];
60 
61 /// Returns the index pointer for code point `code` in this index.
62 #[inline]
backward(code: u32) -> u863 pub fn backward(code: u32) -> u8 {
64     let offset = (code >> 6) as usize;
65     let offset = if offset < 129 {BACKWARD_TABLE_UPPER[offset] as usize} else {0};
66     BACKWARD_TABLE_LOWER[offset + ((code & 63) as usize)]
67 }
68 
69 #[cfg(test)]
70 single_byte_tests!(
71     mod = iso_8859_13
72 );
73