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

Method parse

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

Source from the content-addressed store, hash-verified

7761 this.args = { target: targetExpr };
7762 }
7763 static parse(parser) {
7764 if (!parser.matchToken("show")) return;
7765 var targetExpr = VisibilityCommand.parseShowHideTarget(parser);
7766 var name = null;
7767 if (parser.matchToken("with")) {
7768 name = parser.requireTokenType("IDENTIFIER", "STYLE_REF").value;
7769 if (name.startsWith("*")) {
7770 name = name.slice(1);
7771 }
7772 }
7773 var arg = null;
7774 if (parser.matchOpToken(":")) {
7775 var tokenArr = parser.consumeUntilWhitespace();
7776 parser.matchTokenType("WHITESPACE");
7777 arg = tokenArr.map(function(t) {
7778 return t.value;
7779 }).join("");
7780 }
7781 if (parser.matchToken("when")) {
7782 var when = parser.requireElement("expression");
7783 }
7784 var hideShowStrategy = VisibilityCommand.resolveHideShowStrategy(parser, name);
7785 return new _ShowCommand(targetExpr, when, arg, hideShowStrategy);
7786 }
7787 resolve(ctx, { target }) {
7788 var runtime2 = ctx.meta.runtime;
7789 var cmd = this;

Callers

nothing calls this directly

Calls 8

matchTokenMethod · 0.45
parseShowHideTargetMethod · 0.45
requireTokenTypeMethod · 0.45
matchOpTokenMethod · 0.45
matchTokenTypeMethod · 0.45
requireElementMethod · 0.45

Tested by

no test coverage detected