mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Support parsing const enums.
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user