()
| 9647 | } |
| 9648 | |
| 9649 | function collectToken() { |
| 9650 | var loc, token, range, value, entry; |
| 9651 | |
| 9652 | /* istanbul ignore else */ |
| 9653 | if (!state.inJSXChild) { |
| 9654 | skipComment(); |
| 9655 | } |
| 9656 | |
| 9657 | loc = { |
| 9658 | start: { |
| 9659 | line: lineNumber, |
| 9660 | column: index - lineStart |
| 9661 | } |
| 9662 | }; |
| 9663 | |
| 9664 | token = extra.advance(); |
| 9665 | loc.end = { |
| 9666 | line: lineNumber, |
| 9667 | column: index - lineStart |
| 9668 | }; |
| 9669 | |
| 9670 | if (token.type !== Token.EOF) { |
| 9671 | range = [token.range[0], token.range[1]]; |
| 9672 | value = source.slice(token.range[0], token.range[1]); |
| 9673 | entry = { |
| 9674 | type: TokenName[token.type], |
| 9675 | value: value, |
| 9676 | range: range, |
| 9677 | loc: loc |
| 9678 | }; |
| 9679 | if (token.regex) { |
| 9680 | entry.regex = { |
| 9681 | pattern: token.regex.pattern, |
| 9682 | flags: token.regex.flags |
| 9683 | }; |
| 9684 | } |
| 9685 | extra.tokens.push(entry); |
| 9686 | } |
| 9687 | |
| 9688 | return token; |
| 9689 | } |
| 9690 | |
| 9691 | function collectRegex() { |
| 9692 | var pos, loc, regex, token; |
nothing calls this directly
no test coverage detected