revert changes to classify a keyword as an identifier if the last token is keyword

This commit is contained in:
Mohamed Hegazy 2014-08-08 16:43:31 -07:00
parent ad9a87dfb6
commit 17c45ed986
2 changed files with 1 additions and 18 deletions

View File

@ -659,7 +659,6 @@ module ts {
InMultiLineCommentTrivia,
InSingleQuoteStringLiteral,
InDoubleQuoteStringLiteral,
EndingWithKeyword,
EndingWithDotToken,
}
@ -2243,9 +2242,6 @@ module ts {
case EndOfLineState.EndingWithDotToken:
lastToken = SyntaxKind.DotToken;
break;
case EndOfLineState.EndingWithKeyword:
lastToken = SyntaxKind.FirstKeyword;
break;
}
var result: ClassificationResult = {
@ -2264,7 +2260,7 @@ module ts {
token = SyntaxKind.RegularExpressionLiteral;
}
}
else if (isKeyword(token) && (isKeyword(lastToken) || lastToken === SyntaxKind.DotToken)) {
else if (lastToken === SyntaxKind.DotToken) {
token = SyntaxKind.Identifier;
}
@ -2316,9 +2312,6 @@ module ts {
else if (token === SyntaxKind.DotToken) {
result.finalLexState = EndOfLineState.EndingWithDotToken;
}
else if (isKeyword(token)) {
result.finalLexState = EndOfLineState.EndingWithKeyword;
}
}
}

View File

@ -222,16 +222,6 @@ describe('Colorization', function () {
verifyClassification(results.tuples[2], 3, ts.TokenClass.Identifier);
});
it("classifies keyword after a keyword", function () {
var results = getClassifications("module string", ts.EndOfLineState.Start);
verifyClassification(results.tuples[2], 6, ts.TokenClass.Identifier);
});
it("reports correct state with a line ending in a keyword", function () {
var results = getClassifications("module", ts.EndOfLineState.Start);
assert.equal(results.finalEndOfLineState, ts.EndOfLineState.EndingWithKeyword);
});
it("classifies keyword after a dot on previous line", function () {
var results = getClassifications("var", ts.EndOfLineState.EndingWithDotToken);