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

Method parse

www/js/_hyperscript-max.js:9018–9042  ·  view source on GitHub ↗
(parser)

Source from the content-addressed store, hash-verified

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