diff --git a/src/services/syntax/parser.ts b/src/services/syntax/parser.ts index f276ffd9561..f55577dded1 100644 --- a/src/services/syntax/parser.ts +++ b/src/services/syntax/parser.ts @@ -1098,6 +1098,7 @@ module TypeScript.Parser { case SyntaxKind.StaticKeyword: case SyntaxKind.DeclareKeyword: case SyntaxKind.AsyncKeyword: + case SyntaxKind.ConstKeyword: return true; } @@ -1117,6 +1118,11 @@ module TypeScript.Parser { } } + if (token.kind === SyntaxKind.ConstKeyword) { + // In order for 'const' to be a modifier, the next token must be 'enum'. + return nextToken.kind === SyntaxKind.EnumKeyword; + } + var nextTokenKind = nextToken.kind; switch (nextTokenKind) { // public foo'