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

Method parse

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

Source from the content-addressed store, hash-verified

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