(parser)
| 1474 | parser.raiseError("Unexpected value: " + parser.currentToken().value); |
| 1475 | } |
| 1476 | parseHyperscriptProgram(parser) { |
| 1477 | var features = []; |
| 1478 | if (parser.hasMore()) { |
| 1479 | while (parser.currentToken().type !== "EOF") { |
| 1480 | var keyword = parser.currentToken().value; |
| 1481 | if (parser.featureStart(parser.currentToken()) || parser.currentToken().value === "(") { |
| 1482 | try { |
| 1483 | var feature = parser.requireElement("feature"); |
| 1484 | features.push(feature); |
| 1485 | parser.matchToken("end"); |
| 1486 | } catch (e) { |
| 1487 | if (e instanceof ParseRecoverySentinel) { |
| 1488 | features.push(new FailedFeature(e.parseError, keyword)); |
| 1489 | this.#syncToFeature(parser); |
| 1490 | } else { |
| 1491 | throw e; |
| 1492 | } |
| 1493 | } |
| 1494 | } else if (parser.currentToken().value === "end") { |
| 1495 | break; |
| 1496 | } else { |
| 1497 | try { |
| 1498 | parser.raiseError(); |
| 1499 | } catch (e) { |
| 1500 | if (e instanceof ParseRecoverySentinel) { |
| 1501 | features.push(new FailedFeature(e.parseError, keyword)); |
| 1502 | this.#syncToFeature(parser); |
| 1503 | } else { |
| 1504 | throw e; |
| 1505 | } |
| 1506 | } |
| 1507 | } |
| 1508 | } |
| 1509 | } |
| 1510 | return new HyperscriptProgram(features); |
| 1511 | } |
| 1512 | use(plugin) { |
| 1513 | plugin(this); |
| 1514 | return this; |
nothing calls this directly
no test coverage detected