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

Method parse

www/js/_hyperscript-max.js:8129–8144  ·  view source on GitHub ↗
(parser)

Source from the content-addressed store, hash-verified

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