* Decompress the ranges into an array of numbers so that the char code * can be used as an index to the lookup
(lookup, set, compressed, value)
| 722 | * can be used as an index to the lookup |
| 723 | */ |
| 724 | function decompress(lookup, set, compressed, value) { |
| 725 | let rangeCount = compressed.length; |
| 726 | for (let i = 0; i < rangeCount; i += 2) { |
| 727 | const start = compressed[i]; |
| 728 | let end = compressed[i + 1]; |
| 729 | end = end > 0 ? end : start + 1; |
| 730 | if (lookup) { |
| 731 | let j = start; |
| 732 | while (j < end) { |
| 733 | lookup[j] = value; |
| 734 | j++; |
| 735 | } |
| 736 | } |
| 737 | if (set) { |
| 738 | for (let ch = start; ch < end; ch++) { |
| 739 | set.add(ch); |
| 740 | } |
| 741 | } |
| 742 | } |
| 743 | } |
| 744 | |
| 745 | // CharFuncLookup functions |
| 746 | function returnToken(token) { |