| 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, |