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

Method parseHyperScript

www/js/_hyperscript.esm.js:1672–1687  ·  view source on GitHub ↗
(tokens)

Source from the content-addressed store, hash-verified

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