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

Method parseHyperScript

www/js/_hyperscript.js:1674–1689  ·  view source on GitHub ↗
(tokens)

Source from the content-addressed store, hash-verified

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