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

Method parse

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

Source from the content-addressed store, hash-verified

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