Support parsing const enums.

This commit is contained in:
Cyrus Najmabadi 2014-11-27 14:28:44 -08:00
parent 2de7beb24c
commit dcfaf6d6d3

View file

@ -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'