MCPcopy Create free account
hub / github.com/dchester/jsonpath / collectToken

Function collectToken

jsonpath.js:1340–1368  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1338 }
1339
1340 function collectToken() {
1341 var loc, token, range, value;
1342
1343 skipComment();
1344 loc = {
1345 start: {
1346 line: lineNumber,
1347 column: index - lineStart
1348 }
1349 };
1350
1351 token = advance();
1352 loc.end = {
1353 line: lineNumber,
1354 column: index - lineStart
1355 };
1356
1357 if (token.type !== Token.EOF) {
1358 value = source.slice(token.start, token.end);
1359 extra.tokens.push({
1360 type: TokenName[token.type],
1361 value: value,
1362 range: [token.start, token.end],
1363 loc: loc
1364 });
1365 }
1366
1367 return token;
1368 }
1369
1370 function lex() {
1371 var token;

Callers 2

lexFunction · 0.85
peekFunction · 0.85

Calls 2

skipCommentFunction · 0.85
advanceFunction · 0.85

Tested by

no test coverage detected