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

Method parse

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

Source from the content-addressed store, hash-verified

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