mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Scanner updates for decorators
This commit is contained in:
@@ -148,6 +148,7 @@ module ts {
|
||||
"&=": SyntaxKind.AmpersandEqualsToken,
|
||||
"|=": SyntaxKind.BarEqualsToken,
|
||||
"^=": SyntaxKind.CaretEqualsToken,
|
||||
"@": SyntaxKind.AtToken,
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -315,6 +316,19 @@ module ts {
|
||||
return computeLineAndCharacterOfPosition(getLineStarts(sourceFile), position);
|
||||
}
|
||||
|
||||
export function lineBreakBetween(sourceFile: SourceFile, firstPos: number, secondPos: number): boolean {
|
||||
var lineStarts = getLineStarts(sourceFile);
|
||||
var firstLine = binarySearch(lineStarts, firstPos);
|
||||
var secondLine = binarySearch(lineStarts, secondPos);
|
||||
if (firstLine < 0) {
|
||||
firstLine = ~firstLine - 1;
|
||||
}
|
||||
if (secondLine < 0) {
|
||||
secondLine = ~secondLine - 1;
|
||||
}
|
||||
return firstLine !== secondLine;
|
||||
}
|
||||
|
||||
let hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
|
||||
export function isWhiteSpace(ch: number): boolean {
|
||||
@@ -1247,6 +1261,8 @@ module ts {
|
||||
return pos++, token = SyntaxKind.CloseBraceToken;
|
||||
case CharacterCodes.tilde:
|
||||
return pos++, token = SyntaxKind.TildeToken;
|
||||
case CharacterCodes.at:
|
||||
return pos++, token = SyntaxKind.AtToken;
|
||||
case CharacterCodes.backslash:
|
||||
let cookedChar = peekUnicodeEscape();
|
||||
if (cookedChar >= 0 && isIdentifierStart(cookedChar)) {
|
||||
|
||||
Reference in New Issue
Block a user