Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
michael@0 | 1 | |
michael@0 | 2 | #line 1 "../../src/hb-buffer-deserialize-json.rl" |
michael@0 | 3 | /* |
michael@0 | 4 | * Copyright © 2013 Google, Inc. |
michael@0 | 5 | * |
michael@0 | 6 | * This is part of HarfBuzz, a text shaping library. |
michael@0 | 7 | * |
michael@0 | 8 | * Permission is hereby granted, without written agreement and without |
michael@0 | 9 | * license or royalty fees, to use, copy, modify, and distribute this |
michael@0 | 10 | * software and its documentation for any purpose, provided that the |
michael@0 | 11 | * above copyright notice and the following two paragraphs appear in |
michael@0 | 12 | * all copies of this software. |
michael@0 | 13 | * |
michael@0 | 14 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR |
michael@0 | 15 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES |
michael@0 | 16 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN |
michael@0 | 17 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH |
michael@0 | 18 | * DAMAGE. |
michael@0 | 19 | * |
michael@0 | 20 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, |
michael@0 | 21 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND |
michael@0 | 22 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS |
michael@0 | 23 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO |
michael@0 | 24 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
michael@0 | 25 | * |
michael@0 | 26 | * Google Author(s): Behdad Esfahbod |
michael@0 | 27 | */ |
michael@0 | 28 | |
michael@0 | 29 | #ifndef HB_BUFFER_DESERIALIZE_JSON_HH |
michael@0 | 30 | #define HB_BUFFER_DESERIALIZE_JSON_HH |
michael@0 | 31 | |
michael@0 | 32 | #include "hb-private.hh" |
michael@0 | 33 | |
michael@0 | 34 | |
michael@0 | 35 | #line 36 "hb-buffer-deserialize-json.hh.tmp" |
michael@0 | 36 | static const unsigned char _deserialize_json_trans_keys[] = { |
michael@0 | 37 | 0u, 0u, 9u, 123u, 9u, 34u, 97u, 103u, 120u, 121u, 34u, 34u, 9u, 58u, 9u, 57u, |
michael@0 | 38 | 48u, 57u, 9u, 125u, 9u, 125u, 9u, 125u, 34u, 34u, 9u, 58u, 9u, 57u, 48u, 57u, |
michael@0 | 39 | 9u, 125u, 9u, 125u, 108u, 108u, 34u, 34u, 9u, 58u, 9u, 57u, 9u, 125u, 9u, 125u, |
michael@0 | 40 | 120u, 121u, 34u, 34u, 9u, 58u, 9u, 57u, 48u, 57u, 9u, 125u, 9u, 125u, 34u, 34u, |
michael@0 | 41 | 9u, 58u, 9u, 57u, 48u, 57u, 9u, 125u, 9u, 125u, 34u, 34u, 9u, 58u, 9u, 57u, |
michael@0 | 42 | 65u, 122u, 34u, 122u, 9u, 125u, 9u, 125u, 9u, 93u, 9u, 123u, 0u, 0u, 0 |
michael@0 | 43 | }; |
michael@0 | 44 | |
michael@0 | 45 | static const char _deserialize_json_key_spans[] = { |
michael@0 | 46 | 0, 115, 26, 7, 2, 1, 50, 49, |
michael@0 | 47 | 10, 117, 117, 117, 1, 50, 49, 10, |
michael@0 | 48 | 117, 117, 1, 1, 50, 49, 117, 117, |
michael@0 | 49 | 2, 1, 50, 49, 10, 117, 117, 1, |
michael@0 | 50 | 50, 49, 10, 117, 117, 1, 50, 49, |
michael@0 | 51 | 58, 89, 117, 117, 85, 115, 0 |
michael@0 | 52 | }; |
michael@0 | 53 | |
michael@0 | 54 | static const short _deserialize_json_index_offsets[] = { |
michael@0 | 55 | 0, 0, 116, 143, 151, 154, 156, 207, |
michael@0 | 56 | 257, 268, 386, 504, 622, 624, 675, 725, |
michael@0 | 57 | 736, 854, 972, 974, 976, 1027, 1077, 1195, |
michael@0 | 58 | 1313, 1316, 1318, 1369, 1419, 1430, 1548, 1666, |
michael@0 | 59 | 1668, 1719, 1769, 1780, 1898, 2016, 2018, 2069, |
michael@0 | 60 | 2119, 2178, 2268, 2386, 2504, 2590, 2706 |
michael@0 | 61 | }; |
michael@0 | 62 | |
michael@0 | 63 | static const char _deserialize_json_indicies[] = { |
michael@0 | 64 | 0, 0, 0, 0, 0, 1, 1, |
michael@0 | 65 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 66 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 67 | 0, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 68 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 69 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 70 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 71 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 72 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 73 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 74 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 75 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 76 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 77 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 78 | 1, 1, 1, 2, 1, 3, 3, 3, |
michael@0 | 79 | 3, 3, 1, 1, 1, 1, 1, 1, |
michael@0 | 80 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 81 | 1, 1, 1, 1, 3, 1, 4, 1, |
michael@0 | 82 | 5, 1, 6, 7, 1, 1, 8, 1, |
michael@0 | 83 | 9, 10, 1, 11, 1, 11, 11, 11, |
michael@0 | 84 | 11, 11, 1, 1, 1, 1, 1, 1, |
michael@0 | 85 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 86 | 1, 1, 1, 1, 11, 1, 1, 1, |
michael@0 | 87 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 88 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 89 | 1, 1, 1, 1, 1, 1, 12, 1, |
michael@0 | 90 | 12, 12, 12, 12, 12, 1, 1, 1, |
michael@0 | 91 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 92 | 1, 1, 1, 1, 1, 1, 1, 12, |
michael@0 | 93 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 94 | 1, 1, 1, 1, 13, 1, 1, 14, |
michael@0 | 95 | 15, 15, 15, 15, 15, 15, 15, 15, |
michael@0 | 96 | 15, 1, 16, 17, 17, 17, 17, 17, |
michael@0 | 97 | 17, 17, 17, 17, 1, 18, 18, 18, |
michael@0 | 98 | 18, 18, 1, 1, 1, 1, 1, 1, |
michael@0 | 99 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 100 | 1, 1, 1, 1, 18, 1, 1, 1, |
michael@0 | 101 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 102 | 19, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 103 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 104 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 105 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 106 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 107 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 108 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 109 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 110 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 111 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 112 | 1, 20, 1, 21, 21, 21, 21, 21, |
michael@0 | 113 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 114 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 115 | 1, 1, 21, 1, 1, 1, 1, 1, |
michael@0 | 116 | 1, 1, 1, 1, 1, 1, 3, 1, |
michael@0 | 117 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 118 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 119 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 120 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 121 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 122 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 123 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 124 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 125 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 126 | 1, 1, 1, 1, 1, 1, 1, 22, |
michael@0 | 127 | 1, 18, 18, 18, 18, 18, 1, 1, |
michael@0 | 128 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 129 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 130 | 18, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 131 | 1, 1, 1, 1, 19, 1, 1, 1, |
michael@0 | 132 | 17, 17, 17, 17, 17, 17, 17, 17, |
michael@0 | 133 | 17, 17, 1, 1, 1, 1, 1, 1, |
michael@0 | 134 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 135 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 136 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 137 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 138 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 139 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 140 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 141 | 1, 1, 1, 1, 1, 20, 1, 23, |
michael@0 | 142 | 1, 23, 23, 23, 23, 23, 1, 1, |
michael@0 | 143 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 144 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 145 | 23, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 146 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 147 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 148 | 1, 1, 24, 1, 24, 24, 24, 24, |
michael@0 | 149 | 24, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 150 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 151 | 1, 1, 1, 24, 1, 1, 1, 1, |
michael@0 | 152 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 153 | 25, 1, 1, 26, 27, 27, 27, 27, |
michael@0 | 154 | 27, 27, 27, 27, 27, 1, 28, 29, |
michael@0 | 155 | 29, 29, 29, 29, 29, 29, 29, 29, |
michael@0 | 156 | 1, 30, 30, 30, 30, 30, 1, 1, |
michael@0 | 157 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 158 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 159 | 30, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 160 | 1, 1, 1, 1, 31, 1, 1, 1, |
michael@0 | 161 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 162 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 163 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 164 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 165 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 166 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 167 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 168 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 169 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 170 | 1, 1, 1, 1, 1, 32, 1, 30, |
michael@0 | 171 | 30, 30, 30, 30, 1, 1, 1, 1, |
michael@0 | 172 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 173 | 1, 1, 1, 1, 1, 1, 30, 1, |
michael@0 | 174 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 175 | 1, 1, 31, 1, 1, 1, 29, 29, |
michael@0 | 176 | 29, 29, 29, 29, 29, 29, 29, 29, |
michael@0 | 177 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 178 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 179 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 180 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 181 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 182 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 183 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 184 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 185 | 1, 1, 1, 32, 1, 33, 1, 34, |
michael@0 | 186 | 1, 34, 34, 34, 34, 34, 1, 1, |
michael@0 | 187 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 188 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 189 | 34, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 190 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 191 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 192 | 1, 1, 35, 1, 35, 35, 35, 35, |
michael@0 | 193 | 35, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 194 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 195 | 1, 1, 1, 35, 1, 1, 1, 1, |
michael@0 | 196 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 197 | 1, 1, 1, 36, 37, 37, 37, 37, |
michael@0 | 198 | 37, 37, 37, 37, 37, 1, 38, 38, |
michael@0 | 199 | 38, 38, 38, 1, 1, 1, 1, 1, |
michael@0 | 200 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 201 | 1, 1, 1, 1, 1, 38, 1, 1, |
michael@0 | 202 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 203 | 1, 39, 1, 1, 1, 1, 1, 1, |
michael@0 | 204 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 205 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 206 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 207 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 208 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 209 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 210 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 211 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 212 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 213 | 1, 1, 40, 1, 38, 38, 38, 38, |
michael@0 | 214 | 38, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 215 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 216 | 1, 1, 1, 38, 1, 1, 1, 1, |
michael@0 | 217 | 1, 1, 1, 1, 1, 1, 1, 39, |
michael@0 | 218 | 1, 1, 1, 41, 41, 41, 41, 41, |
michael@0 | 219 | 41, 41, 41, 41, 41, 1, 1, 1, |
michael@0 | 220 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 221 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 222 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 223 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 224 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 225 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 226 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 227 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 228 | 40, 1, 42, 43, 1, 44, 1, 44, |
michael@0 | 229 | 44, 44, 44, 44, 1, 1, 1, 1, |
michael@0 | 230 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 231 | 1, 1, 1, 1, 1, 1, 44, 1, |
michael@0 | 232 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 233 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 234 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 235 | 45, 1, 45, 45, 45, 45, 45, 1, |
michael@0 | 236 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 237 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 238 | 1, 45, 1, 1, 1, 1, 1, 1, |
michael@0 | 239 | 1, 1, 1, 1, 1, 1, 46, 1, |
michael@0 | 240 | 1, 47, 48, 48, 48, 48, 48, 48, |
michael@0 | 241 | 48, 48, 48, 1, 49, 50, 50, 50, |
michael@0 | 242 | 50, 50, 50, 50, 50, 50, 1, 51, |
michael@0 | 243 | 51, 51, 51, 51, 1, 1, 1, 1, |
michael@0 | 244 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 245 | 1, 1, 1, 1, 1, 1, 51, 1, |
michael@0 | 246 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 247 | 1, 1, 52, 1, 1, 1, 1, 1, |
michael@0 | 248 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 249 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 250 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 251 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 252 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 253 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 254 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 255 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 256 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 257 | 1, 1, 1, 53, 1, 51, 51, 51, |
michael@0 | 258 | 51, 51, 1, 1, 1, 1, 1, 1, |
michael@0 | 259 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 260 | 1, 1, 1, 1, 51, 1, 1, 1, |
michael@0 | 261 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 262 | 52, 1, 1, 1, 50, 50, 50, 50, |
michael@0 | 263 | 50, 50, 50, 50, 50, 50, 1, 1, |
michael@0 | 264 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 265 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 266 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 267 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 268 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 269 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 270 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 271 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 272 | 1, 53, 1, 54, 1, 54, 54, 54, |
michael@0 | 273 | 54, 54, 1, 1, 1, 1, 1, 1, |
michael@0 | 274 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 275 | 1, 1, 1, 1, 54, 1, 1, 1, |
michael@0 | 276 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 277 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 278 | 1, 1, 1, 1, 1, 1, 55, 1, |
michael@0 | 279 | 55, 55, 55, 55, 55, 1, 1, 1, |
michael@0 | 280 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 281 | 1, 1, 1, 1, 1, 1, 1, 55, |
michael@0 | 282 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 283 | 1, 1, 1, 1, 56, 1, 1, 57, |
michael@0 | 284 | 58, 58, 58, 58, 58, 58, 58, 58, |
michael@0 | 285 | 58, 1, 59, 60, 60, 60, 60, 60, |
michael@0 | 286 | 60, 60, 60, 60, 1, 61, 61, 61, |
michael@0 | 287 | 61, 61, 1, 1, 1, 1, 1, 1, |
michael@0 | 288 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 289 | 1, 1, 1, 1, 61, 1, 1, 1, |
michael@0 | 290 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 291 | 62, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 292 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 293 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 294 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 295 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 296 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 297 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 298 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 299 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 300 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 301 | 1, 63, 1, 61, 61, 61, 61, 61, |
michael@0 | 302 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 303 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 304 | 1, 1, 61, 1, 1, 1, 1, 1, |
michael@0 | 305 | 1, 1, 1, 1, 1, 1, 62, 1, |
michael@0 | 306 | 1, 1, 60, 60, 60, 60, 60, 60, |
michael@0 | 307 | 60, 60, 60, 60, 1, 1, 1, 1, |
michael@0 | 308 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 309 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 310 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 311 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 312 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 313 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 314 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 315 | 1, 1, 1, 1, 1, 1, 1, 63, |
michael@0 | 316 | 1, 64, 1, 64, 64, 64, 64, 64, |
michael@0 | 317 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 318 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 319 | 1, 1, 64, 1, 1, 1, 1, 1, |
michael@0 | 320 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 321 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 322 | 1, 1, 1, 1, 65, 1, 65, 65, |
michael@0 | 323 | 65, 65, 65, 1, 1, 1, 1, 1, |
michael@0 | 324 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 325 | 1, 1, 1, 1, 1, 65, 1, 66, |
michael@0 | 326 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 327 | 1, 1, 1, 1, 1, 67, 68, 68, |
michael@0 | 328 | 68, 68, 68, 68, 68, 68, 68, 1, |
michael@0 | 329 | 69, 69, 69, 69, 69, 69, 69, 69, |
michael@0 | 330 | 69, 69, 69, 69, 69, 69, 69, 69, |
michael@0 | 331 | 69, 69, 69, 69, 69, 69, 69, 69, |
michael@0 | 332 | 69, 69, 1, 1, 1, 1, 1, 1, |
michael@0 | 333 | 69, 69, 69, 69, 69, 69, 69, 69, |
michael@0 | 334 | 69, 69, 69, 69, 69, 69, 69, 69, |
michael@0 | 335 | 69, 69, 69, 69, 69, 69, 69, 69, |
michael@0 | 336 | 69, 69, 1, 70, 1, 1, 1, 1, |
michael@0 | 337 | 1, 1, 1, 1, 1, 1, 71, 71, |
michael@0 | 338 | 1, 71, 71, 71, 71, 71, 71, 71, |
michael@0 | 339 | 71, 71, 71, 1, 1, 1, 1, 1, |
michael@0 | 340 | 1, 1, 71, 71, 71, 71, 71, 71, |
michael@0 | 341 | 71, 71, 71, 71, 71, 71, 71, 71, |
michael@0 | 342 | 71, 71, 71, 71, 71, 71, 71, 71, |
michael@0 | 343 | 71, 71, 71, 71, 1, 1, 1, 1, |
michael@0 | 344 | 71, 1, 71, 71, 71, 71, 71, 71, |
michael@0 | 345 | 71, 71, 71, 71, 71, 71, 71, 71, |
michael@0 | 346 | 71, 71, 71, 71, 71, 71, 71, 71, |
michael@0 | 347 | 71, 71, 71, 71, 1, 72, 72, 72, |
michael@0 | 348 | 72, 72, 1, 1, 1, 1, 1, 1, |
michael@0 | 349 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 350 | 1, 1, 1, 1, 72, 1, 1, 1, |
michael@0 | 351 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 352 | 73, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 353 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 354 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 355 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 356 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 357 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 358 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 359 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 360 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 361 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 362 | 1, 74, 1, 72, 72, 72, 72, 72, |
michael@0 | 363 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 364 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 365 | 1, 1, 72, 1, 1, 1, 1, 1, |
michael@0 | 366 | 1, 1, 1, 1, 1, 1, 73, 1, |
michael@0 | 367 | 1, 1, 75, 75, 75, 75, 75, 75, |
michael@0 | 368 | 75, 75, 75, 75, 1, 1, 1, 1, |
michael@0 | 369 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 370 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 371 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 372 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 373 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 374 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 375 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 376 | 1, 1, 1, 1, 1, 1, 1, 74, |
michael@0 | 377 | 1, 76, 76, 76, 76, 76, 1, 1, |
michael@0 | 378 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 379 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 380 | 76, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 381 | 1, 1, 1, 1, 77, 1, 1, 1, |
michael@0 | 382 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 383 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 384 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 385 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 386 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 387 | 1, 1, 1, 1, 1, 78, 1, 0, |
michael@0 | 388 | 0, 0, 0, 0, 1, 1, 1, 1, |
michael@0 | 389 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 390 | 1, 1, 1, 1, 1, 1, 0, 1, |
michael@0 | 391 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 392 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 393 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 394 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 395 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 396 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 397 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 398 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 399 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 400 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 401 | 1, 1, 1, 1, 1, 1, 1, 1, |
michael@0 | 402 | 1, 2, 1, 1, 0 |
michael@0 | 403 | }; |
michael@0 | 404 | |
michael@0 | 405 | static const char _deserialize_json_trans_targs[] = { |
michael@0 | 406 | 1, 0, 2, 2, 3, 4, 18, 24, |
michael@0 | 407 | 37, 5, 12, 6, 7, 8, 9, 11, |
michael@0 | 408 | 9, 11, 10, 2, 44, 10, 44, 13, |
michael@0 | 409 | 14, 15, 16, 17, 16, 17, 10, 2, |
michael@0 | 410 | 44, 19, 20, 21, 22, 23, 10, 2, |
michael@0 | 411 | 44, 23, 25, 31, 26, 27, 28, 29, |
michael@0 | 412 | 30, 29, 30, 10, 2, 44, 32, 33, |
michael@0 | 413 | 34, 35, 36, 35, 36, 10, 2, 44, |
michael@0 | 414 | 38, 39, 40, 42, 43, 41, 10, 41, |
michael@0 | 415 | 10, 2, 44, 43, 44, 45, 46 |
michael@0 | 416 | }; |
michael@0 | 417 | |
michael@0 | 418 | static const char _deserialize_json_trans_actions[] = { |
michael@0 | 419 | 0, 0, 1, 0, 0, 0, 0, 0, |
michael@0 | 420 | 0, 0, 0, 0, 0, 2, 2, 2, |
michael@0 | 421 | 0, 0, 3, 3, 4, 0, 5, 0, |
michael@0 | 422 | 0, 2, 2, 2, 0, 0, 6, 6, |
michael@0 | 423 | 7, 0, 0, 0, 2, 2, 8, 8, |
michael@0 | 424 | 9, 0, 0, 0, 0, 0, 2, 2, |
michael@0 | 425 | 2, 0, 0, 10, 10, 11, 0, 0, |
michael@0 | 426 | 2, 2, 2, 0, 0, 12, 12, 13, |
michael@0 | 427 | 0, 0, 0, 2, 2, 2, 14, 0, |
michael@0 | 428 | 15, 15, 16, 0, 0, 0, 0 |
michael@0 | 429 | }; |
michael@0 | 430 | |
michael@0 | 431 | static const int deserialize_json_start = 1; |
michael@0 | 432 | static const int deserialize_json_first_final = 44; |
michael@0 | 433 | static const int deserialize_json_error = 0; |
michael@0 | 434 | |
michael@0 | 435 | static const int deserialize_json_en_main = 1; |
michael@0 | 436 | |
michael@0 | 437 | |
michael@0 | 438 | #line 97 "../../src/hb-buffer-deserialize-json.rl" |
michael@0 | 439 | |
michael@0 | 440 | |
michael@0 | 441 | static hb_bool_t |
michael@0 | 442 | _hb_buffer_deserialize_glyphs_json (hb_buffer_t *buffer, |
michael@0 | 443 | const char *buf, |
michael@0 | 444 | unsigned int buf_len, |
michael@0 | 445 | const char **end_ptr, |
michael@0 | 446 | hb_font_t *font) |
michael@0 | 447 | { |
michael@0 | 448 | const char *p = buf, *pe = buf + buf_len; |
michael@0 | 449 | |
michael@0 | 450 | /* Ensure we have positions. */ |
michael@0 | 451 | (void) hb_buffer_get_glyph_positions (buffer, NULL); |
michael@0 | 452 | |
michael@0 | 453 | while (p < pe && ISSPACE (*p)) |
michael@0 | 454 | p++; |
michael@0 | 455 | if (p < pe && *p == (buffer->len ? ',' : '[')) |
michael@0 | 456 | { |
michael@0 | 457 | *end_ptr = ++p; |
michael@0 | 458 | } |
michael@0 | 459 | |
michael@0 | 460 | const char *tok = NULL; |
michael@0 | 461 | int cs; |
michael@0 | 462 | hb_glyph_info_t info; |
michael@0 | 463 | hb_glyph_position_t pos; |
michael@0 | 464 | |
michael@0 | 465 | #line 466 "hb-buffer-deserialize-json.hh.tmp" |
michael@0 | 466 | { |
michael@0 | 467 | cs = deserialize_json_start; |
michael@0 | 468 | } |
michael@0 | 469 | |
michael@0 | 470 | #line 471 "hb-buffer-deserialize-json.hh.tmp" |
michael@0 | 471 | { |
michael@0 | 472 | int _slen; |
michael@0 | 473 | int _trans; |
michael@0 | 474 | const unsigned char *_keys; |
michael@0 | 475 | const char *_inds; |
michael@0 | 476 | if ( p == pe ) |
michael@0 | 477 | goto _test_eof; |
michael@0 | 478 | if ( cs == 0 ) |
michael@0 | 479 | goto _out; |
michael@0 | 480 | _resume: |
michael@0 | 481 | _keys = _deserialize_json_trans_keys + (cs<<1); |
michael@0 | 482 | _inds = _deserialize_json_indicies + _deserialize_json_index_offsets[cs]; |
michael@0 | 483 | |
michael@0 | 484 | _slen = _deserialize_json_key_spans[cs]; |
michael@0 | 485 | _trans = _inds[ _slen > 0 && _keys[0] <=(*p) && |
michael@0 | 486 | (*p) <= _keys[1] ? |
michael@0 | 487 | (*p) - _keys[0] : _slen ]; |
michael@0 | 488 | |
michael@0 | 489 | cs = _deserialize_json_trans_targs[_trans]; |
michael@0 | 490 | |
michael@0 | 491 | if ( _deserialize_json_trans_actions[_trans] == 0 ) |
michael@0 | 492 | goto _again; |
michael@0 | 493 | |
michael@0 | 494 | switch ( _deserialize_json_trans_actions[_trans] ) { |
michael@0 | 495 | case 1: |
michael@0 | 496 | #line 38 "../../src/hb-buffer-deserialize-json.rl" |
michael@0 | 497 | { |
michael@0 | 498 | memset (&info, 0, sizeof (info)); |
michael@0 | 499 | memset (&pos , 0, sizeof (pos )); |
michael@0 | 500 | } |
michael@0 | 501 | break; |
michael@0 | 502 | case 5: |
michael@0 | 503 | #line 43 "../../src/hb-buffer-deserialize-json.rl" |
michael@0 | 504 | { |
michael@0 | 505 | buffer->add_info (info); |
michael@0 | 506 | if (buffer->in_error) |
michael@0 | 507 | return false; |
michael@0 | 508 | buffer->pos[buffer->len - 1] = pos; |
michael@0 | 509 | *end_ptr = p; |
michael@0 | 510 | } |
michael@0 | 511 | break; |
michael@0 | 512 | case 2: |
michael@0 | 513 | #line 51 "../../src/hb-buffer-deserialize-json.rl" |
michael@0 | 514 | { |
michael@0 | 515 | tok = p; |
michael@0 | 516 | } |
michael@0 | 517 | break; |
michael@0 | 518 | case 14: |
michael@0 | 519 | #line 55 "../../src/hb-buffer-deserialize-json.rl" |
michael@0 | 520 | { |
michael@0 | 521 | if (!hb_font_glyph_from_string (font, |
michael@0 | 522 | tok, p - tok, |
michael@0 | 523 | &info.codepoint)) |
michael@0 | 524 | return false; |
michael@0 | 525 | } |
michael@0 | 526 | break; |
michael@0 | 527 | case 15: |
michael@0 | 528 | #line 62 "../../src/hb-buffer-deserialize-json.rl" |
michael@0 | 529 | { if (!parse_uint (tok, p, &info.codepoint)) return false; } |
michael@0 | 530 | break; |
michael@0 | 531 | case 8: |
michael@0 | 532 | #line 63 "../../src/hb-buffer-deserialize-json.rl" |
michael@0 | 533 | { if (!parse_uint (tok, p, &info.cluster )) return false; } |
michael@0 | 534 | break; |
michael@0 | 535 | case 10: |
michael@0 | 536 | #line 64 "../../src/hb-buffer-deserialize-json.rl" |
michael@0 | 537 | { if (!parse_int (tok, p, &pos.x_offset )) return false; } |
michael@0 | 538 | break; |
michael@0 | 539 | case 12: |
michael@0 | 540 | #line 65 "../../src/hb-buffer-deserialize-json.rl" |
michael@0 | 541 | { if (!parse_int (tok, p, &pos.y_offset )) return false; } |
michael@0 | 542 | break; |
michael@0 | 543 | case 3: |
michael@0 | 544 | #line 66 "../../src/hb-buffer-deserialize-json.rl" |
michael@0 | 545 | { if (!parse_int (tok, p, &pos.x_advance)) return false; } |
michael@0 | 546 | break; |
michael@0 | 547 | case 6: |
michael@0 | 548 | #line 67 "../../src/hb-buffer-deserialize-json.rl" |
michael@0 | 549 | { if (!parse_int (tok, p, &pos.y_advance)) return false; } |
michael@0 | 550 | break; |
michael@0 | 551 | case 16: |
michael@0 | 552 | #line 62 "../../src/hb-buffer-deserialize-json.rl" |
michael@0 | 553 | { if (!parse_uint (tok, p, &info.codepoint)) return false; } |
michael@0 | 554 | #line 43 "../../src/hb-buffer-deserialize-json.rl" |
michael@0 | 555 | { |
michael@0 | 556 | buffer->add_info (info); |
michael@0 | 557 | if (buffer->in_error) |
michael@0 | 558 | return false; |
michael@0 | 559 | buffer->pos[buffer->len - 1] = pos; |
michael@0 | 560 | *end_ptr = p; |
michael@0 | 561 | } |
michael@0 | 562 | break; |
michael@0 | 563 | case 9: |
michael@0 | 564 | #line 63 "../../src/hb-buffer-deserialize-json.rl" |
michael@0 | 565 | { if (!parse_uint (tok, p, &info.cluster )) return false; } |
michael@0 | 566 | #line 43 "../../src/hb-buffer-deserialize-json.rl" |
michael@0 | 567 | { |
michael@0 | 568 | buffer->add_info (info); |
michael@0 | 569 | if (buffer->in_error) |
michael@0 | 570 | return false; |
michael@0 | 571 | buffer->pos[buffer->len - 1] = pos; |
michael@0 | 572 | *end_ptr = p; |
michael@0 | 573 | } |
michael@0 | 574 | break; |
michael@0 | 575 | case 11: |
michael@0 | 576 | #line 64 "../../src/hb-buffer-deserialize-json.rl" |
michael@0 | 577 | { if (!parse_int (tok, p, &pos.x_offset )) return false; } |
michael@0 | 578 | #line 43 "../../src/hb-buffer-deserialize-json.rl" |
michael@0 | 579 | { |
michael@0 | 580 | buffer->add_info (info); |
michael@0 | 581 | if (buffer->in_error) |
michael@0 | 582 | return false; |
michael@0 | 583 | buffer->pos[buffer->len - 1] = pos; |
michael@0 | 584 | *end_ptr = p; |
michael@0 | 585 | } |
michael@0 | 586 | break; |
michael@0 | 587 | case 13: |
michael@0 | 588 | #line 65 "../../src/hb-buffer-deserialize-json.rl" |
michael@0 | 589 | { if (!parse_int (tok, p, &pos.y_offset )) return false; } |
michael@0 | 590 | #line 43 "../../src/hb-buffer-deserialize-json.rl" |
michael@0 | 591 | { |
michael@0 | 592 | buffer->add_info (info); |
michael@0 | 593 | if (buffer->in_error) |
michael@0 | 594 | return false; |
michael@0 | 595 | buffer->pos[buffer->len - 1] = pos; |
michael@0 | 596 | *end_ptr = p; |
michael@0 | 597 | } |
michael@0 | 598 | break; |
michael@0 | 599 | case 4: |
michael@0 | 600 | #line 66 "../../src/hb-buffer-deserialize-json.rl" |
michael@0 | 601 | { if (!parse_int (tok, p, &pos.x_advance)) return false; } |
michael@0 | 602 | #line 43 "../../src/hb-buffer-deserialize-json.rl" |
michael@0 | 603 | { |
michael@0 | 604 | buffer->add_info (info); |
michael@0 | 605 | if (buffer->in_error) |
michael@0 | 606 | return false; |
michael@0 | 607 | buffer->pos[buffer->len - 1] = pos; |
michael@0 | 608 | *end_ptr = p; |
michael@0 | 609 | } |
michael@0 | 610 | break; |
michael@0 | 611 | case 7: |
michael@0 | 612 | #line 67 "../../src/hb-buffer-deserialize-json.rl" |
michael@0 | 613 | { if (!parse_int (tok, p, &pos.y_advance)) return false; } |
michael@0 | 614 | #line 43 "../../src/hb-buffer-deserialize-json.rl" |
michael@0 | 615 | { |
michael@0 | 616 | buffer->add_info (info); |
michael@0 | 617 | if (buffer->in_error) |
michael@0 | 618 | return false; |
michael@0 | 619 | buffer->pos[buffer->len - 1] = pos; |
michael@0 | 620 | *end_ptr = p; |
michael@0 | 621 | } |
michael@0 | 622 | break; |
michael@0 | 623 | #line 624 "hb-buffer-deserialize-json.hh.tmp" |
michael@0 | 624 | } |
michael@0 | 625 | |
michael@0 | 626 | _again: |
michael@0 | 627 | if ( cs == 0 ) |
michael@0 | 628 | goto _out; |
michael@0 | 629 | if ( ++p != pe ) |
michael@0 | 630 | goto _resume; |
michael@0 | 631 | _test_eof: {} |
michael@0 | 632 | _out: {} |
michael@0 | 633 | } |
michael@0 | 634 | |
michael@0 | 635 | #line 125 "../../src/hb-buffer-deserialize-json.rl" |
michael@0 | 636 | |
michael@0 | 637 | |
michael@0 | 638 | *end_ptr = p; |
michael@0 | 639 | |
michael@0 | 640 | return p == pe && *(p-1) != ']'; |
michael@0 | 641 | } |
michael@0 | 642 | |
michael@0 | 643 | #endif /* HB_BUFFER_DESERIALIZE_JSON_HH */ |