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

Method parse

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

Source from the content-addressed store, hash-verified

9242 );
9243 }
9244 static parse(parser) {
9245 if (!parser.matchToken("behavior")) return;
9246 var path = parser.requireElement("dotOrColonPath").evalStatically();
9247 var nameSpace = path.split(".");
9248 var name = nameSpace.pop();
9249 var formalParams = [];
9250 if (parser.matchOpToken("(") && !parser.matchOpToken(")")) {
9251 do {
9252 formalParams.push(parser.requireTokenType("IDENTIFIER").value);
9253 } while (parser.matchOpToken(","));
9254 parser.requireOpToken(")");
9255 }
9256 var hs = parser.requireElement("hyperscript");
9257 for (var i = 0; i < hs.features.length; i++) {
9258 var feature = hs.features[i];
9259 feature.behavior = path;
9260 }
9261 return new _BehaviorFeature(path, nameSpace, name, formalParams, hs);
9262 }
9263 };
9264
9265 // src/parsetree/features/install.js

Callers

nothing calls this directly

Calls 6

matchTokenMethod · 0.45
evalStaticallyMethod · 0.45
requireElementMethod · 0.45
matchOpTokenMethod · 0.45
requireTokenTypeMethod · 0.45
requireOpTokenMethod · 0.45

Tested by

no test coverage detected