MCPcopy Index your code
hub / github.com/BloombergGraphics/whatiscode / filterTokenLocation

Function filterTokenLocation

scripts/libs/esprima.js:4303–4328  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4301 }
4302
4303 function filterTokenLocation() {
4304 var i, entry, token, tokens = [];
4305
4306 for (i = 0; i < extra.tokens.length; ++i) {
4307 entry = extra.tokens[i];
4308 token = {
4309 type: entry.type,
4310 value: entry.value
4311 };
4312 if (entry.regex) {
4313 token.regex = {
4314 pattern: entry.regex.pattern,
4315 flags: entry.regex.flags
4316 };
4317 }
4318 if (extra.range) {
4319 token.range = entry.range;
4320 }
4321 if (extra.loc) {
4322 token.loc = entry.loc;
4323 }
4324 tokens.push(token);
4325 }
4326
4327 extra.tokens = tokens;
4328 }
4329
4330 function tokenize(code, options) {
4331 var toString,

Callers 2

tokenizeFunction · 0.85
parseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected