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

Method parse

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

Source from the content-addressed store, hash-verified

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