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

Method parseHyperScript

tools/common/_hyperscript.iife.js:1664–1679  ·  view source on GitHub ↗
(tokens)

Source from the content-addressed store, hash-verified

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