(int e)
| 241 | } |
| 242 | |
| 243 | public int skipVar(int e) { // ']' or '}' |
| 244 | for (int b, c; ; ) { |
| 245 | if ((b = buf[pos]) == ',' || b == '\n') |
| 246 | for (; ; ) |
| 247 | if (((((b = buf[++pos]) & 0xff) - ' ' - 1) ^ (',' - ' ' - 1)) > 0) { // (b & 0xff) > ' ' && b != ',' |
| 248 | if (b != '/') // check comment |
| 249 | return b; |
| 250 | skipComment(); |
| 251 | } |
| 252 | if (b == e) |
| 253 | return b; |
| 254 | pos++; |
| 255 | if (b < '"') // fast path |
| 256 | continue; |
| 257 | if (b == '"' || b == '\'') { |
| 258 | while ((c = buf[pos++]) != b) |
| 259 | if (c == '\\') |
| 260 | pos++; |
| 261 | } else if ((b | 0x20) == '{') { // [:0x5B | 0x20 = {:0x7B |
| 262 | for (int level = 0; (b = buf[pos++] | 0x20) != '}' || --level >= 0; ) { // ]:0x5D | 0x20 = }:0x7D |
| 263 | if (b == '"' || b == '\'') { // '"' = 0x22; '\'' = 0x27 |
| 264 | while ((c = buf[pos++]) != b) |
| 265 | if (c == '\\') |
| 266 | pos++; |
| 267 | } else if (b == '{') // [:0x5B | 0x20 = {:0x7B |
| 268 | level++; |
| 269 | else if (b == '/') { // skip comment |
| 270 | pos--; |
| 271 | skipComment(); |
| 272 | } |
| 273 | } |
| 274 | } else if (b == '/') { // skip comment |
| 275 | pos--; |
| 276 | skipComment(); |
| 277 | } |
| 278 | } |
| 279 | } |
| 280 | |
| 281 | private void skipComment() { |
| 282 | int b; |
no test coverage detected