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

Method parseString

tools/mcdevicetree.js:1323–1339  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1321 }
1322
1323 parseString() {
1324 this.pos++; // consume opening quote
1325 const start = this.pos, length = this.length, content = this.contentS;
1326
1327 while (this.pos < length) {
1328 const c = content.charCodeAt(this.pos);
1329 if (c === QUOTE)
1330 break;
1331 if (c === 92) { // backslash
1332 this.pos += 2; // skip escaped character
1333 } else {
1334 this.pos++;
1335 }
1336 }
1337
1338 return content.slice(start, this.pos++); // consume closing quote
1339 }
1340
1341 parseArray() {
1342 this.pos++; // consume '<'

Callers 1

parseValueMethod · 0.95

Calls 1

sliceMethod · 0.65

Tested by

no test coverage detected