MCPcopy Create free account
hub / github.com/aurelia/binding / decompress

Function decompress

src/parser.js:724–743  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

722 * can be used as an index to the lookup
723 */
724function 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
746function returnToken(token) {

Callers 1

parser.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected