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

Method parse

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

Source from the content-addressed store, hash-verified

967 this.args = args;
968 }
969 static parse(parser) {
970 var token;
971 if (token = parser.matchTokenType("STRING")) {
972 return new _ObjectKey(token.value, null, null);
973 } else if (parser.matchOpToken("[")) {
974 var expr = parser.parseElement("expression");
975 parser.requireOpToken("]");
976 return new _ObjectKey(null, expr, { value: expr });
977 } else {
978 var key = "";
979 do {
980 token = parser.matchTokenType("IDENTIFIER") || parser.matchOpToken("-");
981 if (token) key += token.value;
982 } while (token);
983 return new _ObjectKey(key, null, null);
984 }
985 }
986 evalStatically() {
987 if (!this.expr) return this.key;
988 return super.evalStatically();

Callers

nothing calls this directly

Calls 4

matchTokenTypeMethod · 0.45
matchOpTokenMethod · 0.45
parseElementMethod · 0.45
requireOpTokenMethod · 0.45

Tested by

no test coverage detected