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

Method parse

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

Source from the content-addressed store, hash-verified

8128 this.args = { target: targetExpr };
8129 }
8130 static parse(parser) {
8131 if (!parser.matchToken("hide")) return;
8132 var targetExpr = VisibilityCommand.parseShowHideTarget(parser);
8133 var name = null;
8134 if (parser.matchToken("with")) {
8135 name = parser.requireTokenType("IDENTIFIER", "STYLE_REF").value;
8136 if (name.startsWith("*")) {
8137 name = name.slice(1);
8138 }
8139 }
8140 if (parser.matchToken("when")) {
8141 var when = parser.requireElement("expression");
8142 }
8143 var hideShowStrategy = VisibilityCommand.resolveHideShowStrategy(parser, name);
8144 return new _HideCommand(targetExpr, when, hideShowStrategy);
8145 }
8146 resolve(ctx, { target }) {
8147 var runtime2 = ctx.meta.runtime;
8148 var cmd = this;

Callers

nothing calls this directly

Calls 5

matchTokenMethod · 0.45
parseShowHideTargetMethod · 0.45
requireTokenTypeMethod · 0.45
requireElementMethod · 0.45

Tested by

no test coverage detected