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

Method parseHyperScript

www/js/_hyperscript-max.js:1673–1688  ·  view source on GitHub ↗
(tokens)

Source from the content-addressed store, hash-verified

1671 return this.#features[token.value || ""];
1672 }
1673 parseHyperScript(tokens) {
1674 var parser = new Parser(this, tokens);
1675 var result;
1676 var lastError = null;
1677 try {
1678 result = parser.parseElement("hyperscript");
1679 if (tokens.hasMore()) parser.raiseError();
1680 } catch (e) {
1681 if (!(e instanceof ParseRecoverySentinel)) throw e;
1682 lastError = e.parseError;
1683 }
1684 if (!result) result = new HyperscriptProgram([]);
1685 result.errors = result.collectErrors();
1686 if (lastError) result.errors.push(lastError);
1687 return result;
1688 }
1689 #syncToFeature(parser) {
1690 parser.tokens.clearFollows();
1691 while (parser.hasMore() && !parser.featureStart(parser.currentToken()) && parser.currentToken().value !== "end" && parser.currentToken().type !== "EOF") {

Callers 1

#initElementMethod · 0.45

Calls 4

parseElementMethod · 0.95
raiseErrorMethod · 0.95
hasMoreMethod · 0.45
collectErrorsMethod · 0.45

Tested by

no test coverage detected