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

Method parse

www/js/_hyperscript.js:4241–4258  ·  view source on GitHub ↗
(parser, root)

Source from the content-addressed store, hash-verified

4239 this.args = { root };
4240 }
4241 static parse(parser, root) {
4242 var apostrophe = parser.matchOpToken("'");
4243 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")) {
4244 if (apostrophe) {
4245 parser.requireToken("s");
4246 }
4247 var attribute, style, prop;
4248 attribute = parser.parseElement("attributeRef");
4249 if (attribute == null) {
4250 style = parser.parseElement("styleRef");
4251 if (style == null) {
4252 prop = parser.requireTokenType("IDENTIFIER");
4253 }
4254 }
4255 var propertyAccess = new _PossessiveExpression(root, attribute || style, prop);
4256 return parser.parseElement("indirectExpression", propertyAccess);
4257 }
4258 }
4259 resolve(context, { root: rootVal }) {
4260 var value;
4261 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