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

Method parse

tools/common/_hyperscript.iife.js:8569–8593  ·  view source on GitHub ↗
(parser)

Source from the content-addressed store, hash-verified

8567 this.args = { type: transitionType };
8568 }
8569 static parse(parser) {
8570 if (!parser.matchToken("start")) return;
8571 parser.matchToken("a");
8572 parser.requireToken("view");
8573 parser.requireToken("transition");
8574 parser.matchToken("using");
8575 var typeToken = parser.matchTokenType("STRING");
8576 var transitionType = typeToken ? typeToken.value : null;
8577 var body = parser.requireElement("commandList");
8578 var tick = new ViewTransitionTick();
8579 tick.next = body;
8580 var endCmd = new ViewTransitionEnd();
8581 var last = body;
8582 while (last.next) last = last.next;
8583 last.next = endCmd;
8584 if (parser.hasMore()) {
8585 parser.requireToken("end");
8586 }
8587 insertAborts(body, false);
8588 var cmd = new _ViewTransitionCommand(tick, transitionType);
8589 parser.setParent(tick, cmd);
8590 parser.setParent(body, cmd);
8591 endCmd.parent = cmd;
8592 return cmd;
8593 }
8594 resolve(context, { type }) {
8595 if (!document.startViewTransition) {
8596 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