MCPcopy Create free account
hub / github.com/bigskysoftware/_hyperscript / parse

Method parse

www/js/_hyperscript.esm.js:8840–8863  ·  view source on GitHub ↗
(parser)

Source from the content-addressed store, hash-verified

8838 this.args = { from, to, using: usingExpr, over };
8839 }
8840 static parse(parser) {
8841 if (!parser.matchToken("transition")) return;
8842 var propExprs = [];
8843 var from = [];
8844 var to = [];
8845 do {
8846 var follows = parser.pushFollows("from", "to");
8847 try {
8848 propExprs.push(parser.requireElement("expression"));
8849 } finally {
8850 parser.popFollows(follows);
8851 }
8852 from.push(parser.matchToken("from") ? parser.requireElement("expression") : null);
8853 parser.requireToken("to");
8854 to.push(parser.matchToken("initial") ? "initial" : parser.requireElement("expression"));
8855 } while (!parser.commandBoundary(parser.currentToken()) && parser.currentToken().value !== "over" && parser.currentToken().value !== "using");
8856 var over, usingExpr;
8857 if (parser.matchToken("over")) {
8858 over = parser.requireElement("expression");
8859 } else if (parser.matchToken("using")) {
8860 usingExpr = parser.requireElement("expression");
8861 }
8862 return new _TransitionCommand(propExprs, from, to, usingExpr, over);
8863 }
8864 resolve(context, { from, to, using, over }) {
8865 var cmd = this;
8866 var runtime2 = context.meta.runtime;

Callers

nothing calls this directly

Calls 7

matchTokenMethod · 0.45
pushFollowsMethod · 0.45
requireElementMethod · 0.45
popFollowsMethod · 0.45
requireTokenMethod · 0.45
commandBoundaryMethod · 0.45
currentTokenMethod · 0.45

Tested by

no test coverage detected