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

Method parse

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

Source from the content-addressed store, hash-verified

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