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

Method parsePickRange

src/parsetree/commands/basic.js:404–422  ·  view source on GitHub ↗
(parser)

Source from the content-addressed store, hash-verified

402 }
403
404 static parsePickRange(parser) {
405 parser.matchToken("at") || parser.matchToken("from");
406 var rv = { includeStart: true, includeEnd: false };
407
408 rv.from = parser.matchToken("start") ? 0 : parser.requireElement("expression");
409
410 if (parser.matchToken("to") || parser.matchOpToken("..")) {
411 if (parser.matchToken("end")) {
412 rv.toEnd = true;
413 } else {
414 rv.to = parser.requireElement("expression");
415 }
416 }
417
418 if (parser.matchToken("inclusive")) rv.includeEnd = true;
419 else if (parser.matchToken("exclusive")) rv.includeStart = false;
420
421 return rv;
422 }
423
424 static parseSource(parser) {
425 if (!parser.matchAnyToken("of", "from")) {

Callers 1

parseMethod · 0.45

Calls 3

matchTokenMethod · 0.45
requireElementMethod · 0.45
matchOpTokenMethod · 0.45

Tested by

no test coverage detected