precondition: <! consumed
(boolean push)
| 470 | /** precondition: <! consumed */ |
| 471 | |
| 472 | private final void parseDoctype(boolean push) |
| 473 | throws IOException, XmlPullParserException { |
| 474 | |
| 475 | int nesting = 1; |
| 476 | boolean quoted = false; |
| 477 | |
| 478 | // read(); |
| 479 | |
| 480 | while (true) { |
| 481 | int i = read(); |
| 482 | switch (i) { |
| 483 | |
| 484 | case -1 : |
| 485 | error(UNEXPECTED_EOF); |
| 486 | return; |
| 487 | |
| 488 | case '\'' : |
| 489 | quoted = !quoted; |
| 490 | break; |
| 491 | |
| 492 | case '<' : |
| 493 | if (!quoted) |
| 494 | nesting++; |
| 495 | break; |
| 496 | |
| 497 | case '>' : |
| 498 | if (!quoted) { |
| 499 | if ((--nesting) == 0) |
| 500 | return; |
| 501 | } |
| 502 | break; |
| 503 | } |
| 504 | if (push) |
| 505 | push(i); |
| 506 | } |
| 507 | } |
| 508 | |
| 509 | /* precondition: </ consumed */ |
| 510 |
no test coverage detected