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