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

Method parsePickRange

www/js/_hyperscript-max.js:5993–6007  ·  view source on GitHub ↗
(parser)

Source from the content-addressed store, hash-verified

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