Support parsing const enums.
This commit is contained in:
parent
2de7beb24c
commit
dcfaf6d6d3
|
@ -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'
|
||||
|
|
Loading…
Reference in a new issue