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

Method parsePickRange

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

Source from the content-addressed store, hash-verified

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