| 9732 | } |
| 9733 | |
| 9734 | function filterTokenLocation() { |
| 9735 | var i, entry, token, tokens = []; |
| 9736 | |
| 9737 | for (i = 0; i < extra.tokens.length; ++i) { |
| 9738 | entry = extra.tokens[i]; |
| 9739 | token = { |
| 9740 | type: entry.type, |
| 9741 | value: entry.value |
| 9742 | }; |
| 9743 | if (entry.regex) { |
| 9744 | token.regex = { |
| 9745 | pattern: entry.regex.pattern, |
| 9746 | flags: entry.regex.flags |
| 9747 | }; |
| 9748 | } |
| 9749 | if (extra.range) { |
| 9750 | token.range = entry.range; |
| 9751 | } |
| 9752 | if (extra.loc) { |
| 9753 | token.loc = entry.loc; |
| 9754 | } |
| 9755 | tokens.push(token); |
| 9756 | } |
| 9757 | |
| 9758 | extra.tokens = tokens; |
| 9759 | } |
| 9760 | |
| 9761 | function patch() { |
| 9762 | if (typeof extra.tokens !== 'undefined') { |