()
| 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; |
no test coverage detected