MCPcopy Index your code
hub / github.com/nodejs/node / scanIdentifierParts

Function scanIdentifierParts

test/fixtures/snapshot/typescript.js:11312–11346  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11310 return -1;
11311 }
11312 function scanIdentifierParts() {
11313 var result = "";
11314 var start = pos;
11315 while (pos < end) {
11316 var ch = codePointAt(text, pos);
11317 if (isIdentifierPart(ch, languageVersion)) {
11318 pos += charSize(ch);
11319 }
11320 else if (ch === 92 /* CharacterCodes.backslash */) {
11321 ch = peekExtendedUnicodeEscape();
11322 if (ch >= 0 && isIdentifierPart(ch, languageVersion)) {
11323 pos += 3;
11324 tokenFlags |= 8 /* TokenFlags.ExtendedUnicodeEscape */;
11325 result += scanExtendedUnicodeEscape();
11326 start = pos;
11327 continue;
11328 }
11329 ch = peekUnicodeEscape();
11330 if (!(ch >= 0 && isIdentifierPart(ch, languageVersion))) {
11331 break;
11332 }
11333 tokenFlags |= 1024 /* TokenFlags.UnicodeEscape */;
11334 result += text.substring(start, pos);
11335 result += utf16EncodeAsString(ch);
11336 // Valid Unicode escape is always six characters
11337 pos += 6;
11338 start = pos;
11339 }
11340 else {
11341 break;
11342 }
11343 }
11344 result += text.substring(start, pos);
11345 return result;
11346 }
11347 function getIdentifierToken() {
11348 // Reserved words are between 2 and 12 characters long and start with a lowercase letter
11349 var len = tokenValue.length;

Callers 5

scanFunction · 0.85
scanIdentifierFunction · 0.85
scanJsxIdentifierFunction · 0.85
scanJsDocTokenFunction · 0.85

Calls 6

isIdentifierPartFunction · 0.85
charSizeFunction · 0.85
peekUnicodeEscapeFunction · 0.85
utf16EncodeAsStringFunction · 0.85

Tested by

no test coverage detected