443
return token = SyntaxKind.LineCommentTrivia;
444
}
446
>
// Multi-line comment
447
>
if (text.charCodeAt(pos + 1) === CharacterCodes.asterisk) {
448
>
pos += 2;
449
>
450
>
const safeLength = len - 1; // For lookahead.
451
>
let commentClosed = false;
452
>
while (pos < safeLength) {
453
>
const ch = text.charCodeAt(pos);
454
>
455
>
if (ch === CharacterCodes.asterisk && text.charCodeAt(pos + 1) === CharacterCodes.slash) {
456
>
pos += 2;
457
>
commentClosed = true;
458
>
break;
459
>
}
460
>
pos++;
461
>
}
462
>
463
>
if (!commentClosed) {
464
pos++;
465
scanError = ScanError.UnexpectedEndOfComment;
466
}
468
>
value = text.substring(start, pos);
469
>
return token = SyntaxKind.BlockCommentTrivia;
470
>
}
471
// just a single slash
472
value += String.fromCharCode(code);