MCPcopy Index your code
hub / github.com/bigskysoftware/_hyperscript / parseHyperscriptProgram

Method parseHyperscriptProgram

www/js/_hyperscript-max.js:1477–1512  ·  view source on GitHub ↗
(parser)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 7

hasMoreMethod · 0.45
currentTokenMethod · 0.45
featureStartMethod · 0.45
requireElementMethod · 0.45
matchTokenMethod · 0.45
#syncToFeatureMethod · 0.45
raiseErrorMethod · 0.45

Tested by

no test coverage detected