MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / reportStrings

Method reportStrings

xs/tools/unicode/strings.js:41–58  ·  view source on GitHub ↗
(name, strings)

Source from the content-addressed store, hash-verified

39 this.report("};");
40 }
41 reportStrings(name, strings) {
42 let c = strings.length;
43 this.report(`#define mxStrings_${name} ${c}`);
44 this.report(`static const txString ICACHE_RODATA_ATTR gxStrings_${name}[mxStrings_${name}] = {`);
45 let buffer = "\t";
46 for (let i = 0; i < c; i++) {
47 let string = '"';
48 string += encodeURI(strings[i].bytes).replaceAll("%", "\\x");
49 string += '",';
50 if ((buffer.length + string.length) > 160) {
51 this.report(buffer);
52 buffer = "\t";
53 }
54 buffer += string;
55 }
56 this.report(buffer);
57 this.report("};");
58 }
59 buildRanges(singles) {
60 let ranges = [];
61 let length = singles.length;

Callers 1

runMethod · 0.80

Calls 1

reportMethod · 0.80

Tested by

no test coverage detected