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

Method parse

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

Source from the content-addressed store, hash-verified

5418 this.args = { thing: thingElt, from, inElt, withinElt };
5419 }
5420 static parse(parser) {
5421 var op = parser.matchAnyToken("next", "previous");
5422 if (!op) return;
5423 var forwardSearch = op.value === "next";
5424 var thingElt = parser.parseElement("leaf");
5425 if (parser.matchToken("from")) {
5426 parser.pushFollow("in");
5427 try {
5428 var from = parser.requireElement("unaryExpression");
5429 } finally {
5430 parser.popFollow();
5431 }
5432 } else {
5433 var from = parser.requireElement("implicitMeTarget");
5434 }
5435 var inSearch = false;
5436 var withinElt;
5437 if (parser.matchToken("in")) {
5438 inSearch = true;
5439 var inElt = parser.requireElement("unaryExpression");
5440 } else if (parser.matchToken("within")) {
5441 withinElt = parser.requireElement("unaryExpression");
5442 } else {
5443 withinElt = null;
5444 }
5445 var wrapping = false;
5446 if (parser.matchToken("with")) {
5447 parser.requireToken("wrapping");
5448 wrapping = true;
5449 }
5450 return new _RelativePositionalExpression(
5451 thingElt,
5452 from,
5453 forwardSearch,
5454 inSearch,
5455 wrapping,
5456 inElt,
5457 withinElt,
5458 op.value
5459 );
5460 }
5461 scanForwardQuery(start, root, match, wrap) {
5462 var results = root.querySelectorAll(match);
5463 for (var i = 0; i < results.length; i++) {

Callers

nothing calls this directly

Calls 7

matchAnyTokenMethod · 0.45
parseElementMethod · 0.45
matchTokenMethod · 0.45
pushFollowMethod · 0.45
requireElementMethod · 0.45
popFollowMethod · 0.45
requireTokenMethod · 0.45

Tested by

no test coverage detected