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

Method parse

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

Source from the content-addressed store, hash-verified

9694 );
9695 }
9696 static parse(parser) {
9697 if (!parser.matchToken("behavior")) return;
9698 var path = parser.requireElement("dotOrColonPath").evalStatically();
9699 var nameSpace = path.split(".");
9700 var name = nameSpace.pop();
9701 var formalParams = [];
9702 if (parser.matchOpToken("(") && !parser.matchOpToken(")")) {
9703 do {
9704 formalParams.push(parser.requireTokenType("IDENTIFIER").value);
9705 } while (parser.matchOpToken(","));
9706 parser.requireOpToken(")");
9707 }
9708 var hs = parser.requireElement("hyperscript");
9709 for (var i = 0; i < hs.features.length; i++) {
9710 var feature = hs.features[i];
9711 feature.behavior = path;
9712 }
9713 return new _BehaviorFeature(path, nameSpace, name, formalParams, hs);
9714 }
9715};
9716
9717// 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