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

Method parse

www/js/_hyperscript-max.js:4240–4257  ·  view source on GitHub ↗
(parser, root)

Source from the content-addressed store, hash-verified

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