MCPcopy Create free account
hub / github.com/bigskysoftware/_hyperscript / parse

Method parse

www/js/_hyperscript.esm.js:4239–4256  ·  view source on GitHub ↗
(parser, root)

Source from the content-addressed store, hash-verified

4237 this.args = { root };
4238 }
4239 static parse(parser, root) {
4240 var apostrophe = parser.matchOpToken("'");
4241 if (apostrophe || root.type === "symbol" && (root.name === "my" || root.name === "its" || root.name === "your") && (parser.currentToken().type === "IDENTIFIER" || parser.currentToken().type === "ATTRIBUTE_REF" || parser.currentToken().type === "STYLE_REF")) {
4242 if (apostrophe) {
4243 parser.requireToken("s");
4244 }
4245 var attribute, style, prop;
4246 attribute = parser.parseElement("attributeRef");
4247 if (attribute == null) {
4248 style = parser.parseElement("styleRef");
4249 if (style == null) {
4250 prop = parser.requireTokenType("IDENTIFIER");
4251 }
4252 }
4253 var propertyAccess = new _PossessiveExpression(root, attribute || style, prop);
4254 return parser.parseElement("indirectExpression", propertyAccess);
4255 }
4256 }
4257 resolve(context, { root: rootVal }) {
4258 var value;
4259 if (this.attribute) {

Callers

nothing calls this directly

Calls 5

matchOpTokenMethod · 0.45
currentTokenMethod · 0.45
requireTokenMethod · 0.45
parseElementMethod · 0.45
requireTokenTypeMethod · 0.45

Tested by

no test coverage detected