mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Fix scanner offset and make it easier to read
This commit is contained in:
@@ -1745,10 +1745,10 @@ namespace ts {
|
||||
case CharacterCodes.slash:
|
||||
// Single-line comment
|
||||
if (text.charCodeAt(pos + 1) === CharacterCodes.slash) {
|
||||
pos += 2;
|
||||
if (text.charCodeAt(pos + 2) === CharacterCodes.slash) {
|
||||
tokenFlags |= TokenFlags.PrecedingJSDocComment;
|
||||
}
|
||||
pos += 2;
|
||||
|
||||
while (pos < end) {
|
||||
if (isLineBreak(text.charCodeAt(pos))) {
|
||||
@@ -1773,10 +1773,10 @@ namespace ts {
|
||||
}
|
||||
// Multi-line comment
|
||||
if (text.charCodeAt(pos + 1) === CharacterCodes.asterisk) {
|
||||
pos += 2;
|
||||
if (text.charCodeAt(pos) === CharacterCodes.asterisk && text.charCodeAt(pos + 1) !== CharacterCodes.slash) {
|
||||
if (text.charCodeAt(pos + 2) === CharacterCodes.asterisk && text.charCodeAt(pos + 3) !== CharacterCodes.slash) {
|
||||
tokenFlags |= TokenFlags.PrecedingJSDocComment;
|
||||
}
|
||||
pos += 2;
|
||||
|
||||
let commentClosed = false;
|
||||
let lastLineStart = tokenPos;
|
||||
|
||||
Reference in New Issue
Block a user