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

Method parse

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

Source from the content-addressed store, hash-verified

9017 this.args = { type: transitionType };
9018 }
9019 static parse(parser) {
9020 if (!parser.matchToken("start")) return;
9021 parser.matchToken("a");
9022 parser.requireToken("view");
9023 parser.requireToken("transition");
9024 parser.matchToken("using");
9025 var typeToken = parser.matchTokenType("STRING");
9026 var transitionType = typeToken ? typeToken.value : null;
9027 var body = parser.requireElement("commandList");
9028 var tick = new ViewTransitionTick();
9029 tick.next = body;
9030 var endCmd = new ViewTransitionEnd();
9031 var last = body;
9032 while (last.next) last = last.next;
9033 last.next = endCmd;
9034 if (parser.hasMore()) {
9035 parser.requireToken("end");
9036 }
9037 insertAborts(body, false);
9038 var cmd = new _ViewTransitionCommand(tick, transitionType);
9039 parser.setParent(tick, cmd);
9040 parser.setParent(body, cmd);
9041 endCmd.parent = cmd;
9042 return cmd;
9043 }
9044 resolve(context, { type }) {
9045 if (!document.startViewTransition) {
9046 return this.body;

Callers

nothing calls this directly

Calls 7

insertAbortsFunction · 0.70
matchTokenMethod · 0.45
requireTokenMethod · 0.45
matchTokenTypeMethod · 0.45
requireElementMethod · 0.45
hasMoreMethod · 0.45
setParentMethod · 0.45

Tested by

no test coverage detected