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

Method parse

www/js/_hyperscript.js:8842–8865  ·  view source on GitHub ↗
(parser)

Source from the content-addressed store, hash-verified

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