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

Method parse

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

Source from the content-addressed store, hash-verified

9101 runtime2.assignToNamespace(target, nameSpace, funcName, func);
9102 }
9103 static parse(parser) {
9104 if (!parser.matchToken("def")) return;
9105 var functionName = parser.requireElement("dotOrColonPath");
9106 var nameVal = functionName.evalStatically();
9107 var nameSpace = nameVal.split(".");
9108 var funcName = nameSpace.pop();
9109 var args = [];
9110 if (parser.matchOpToken("(")) {
9111 if (parser.matchOpToken(")")) {
9112 } else {
9113 do {
9114 args.push(parser.requireTokenType("IDENTIFIER"));
9115 } while (parser.matchOpToken(","));
9116 parser.requireOpToken(")");
9117 }
9118 }
9119 var start = parser.requireElement("commandList");
9120 var { errorHandler, errorSymbol, finallyHandler } = Feature.parseErrorAndFinally(parser);
9121 var functionFeature = new _DefFeature(funcName, nameSpace, nameVal, args, start, errorHandler, errorSymbol, finallyHandler);
9122 parser.ensureTerminated(start);
9123 if (errorHandler) {
9124 parser.ensureTerminated(errorHandler);
9125 }
9126 parser.setParent(start, functionFeature);
9127 return functionFeature;
9128 }
9129 };
9130
9131 // src/parsetree/features/set.js

Callers

nothing calls this directly

Calls 9

matchTokenMethod · 0.45
requireElementMethod · 0.45
evalStaticallyMethod · 0.45
matchOpTokenMethod · 0.45
requireTokenTypeMethod · 0.45
requireOpTokenMethod · 0.45
parseErrorAndFinallyMethod · 0.45
ensureTerminatedMethod · 0.45
setParentMethod · 0.45

Tested by

no test coverage detected