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

Method parsePickRange

www/js/_hyperscript.esm.js:5992–6006  ·  view source on GitHub ↗
(parser)

Source from the content-addressed store, hash-verified

5990 }
5991 }
5992 static parsePickRange(parser) {
5993 parser.matchToken("at") || parser.matchToken("from");
5994 var rv = { includeStart: true, includeEnd: false };
5995 rv.from = parser.matchToken("start") ? 0 : parser.requireElement("expression");
5996 if (parser.matchToken("to") || parser.matchOpToken("..")) {
5997 if (parser.matchToken("end")) {
5998 rv.toEnd = true;
5999 } else {
6000 rv.to = parser.requireElement("expression");
6001 }
6002 }
6003 if (parser.matchToken("inclusive")) rv.includeEnd = true;
6004 else if (parser.matchToken("exclusive")) rv.includeStart = false;
6005 return rv;
6006 }
6007 static parseSource(parser) {
6008 if (!parser.matchAnyToken("of", "from")) {
6009 parser.raiseExpected("of", "from");

Callers 1

parseMethod · 0.45

Calls 3

matchTokenMethod · 0.45
requireElementMethod · 0.45
matchOpTokenMethod · 0.45

Tested by

no test coverage detected