From dd1f982bded5c9fd51175be9ce569ac9e97551c3 Mon Sep 17 00:00:00 2001 From: Dick van den Brink Date: Thu, 30 Apr 2015 17:40:35 +0200 Subject: [PATCH] Parse abstract keyword --- src/compiler/scanner.ts | 1 + src/compiler/types.ts | 22 ++++++++++++---------- src/compiler/utilities.ts | 2 ++ 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index f7224e619bb..94cb784ca88 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -43,6 +43,7 @@ module ts { } let textToToken: Map = { + "abstract": SyntaxKind.AbstractKeyword, "any": SyntaxKind.AnyKeyword, "as": SyntaxKind.AsKeyword, "boolean": SyntaxKind.BooleanKeyword, diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 4799f314063..1185b949e9c 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -131,6 +131,7 @@ module ts { StaticKeyword, YieldKeyword, // Contextual keywords + AbstractKeyword, AsKeyword, AnyKeyword, BooleanKeyword, @@ -307,17 +308,18 @@ module ts { Private = 0x00000020, // Property/Method Protected = 0x00000040, // Property/Method Static = 0x00000080, // Property/Method - Default = 0x00000100, // Function/Class (export default declaration) - MultiLine = 0x00000200, // Multi-line array or object literal - Synthetic = 0x00000400, // Synthetic node (for full fidelity) - DeclarationFile = 0x00000800, // Node is a .d.ts file - Let = 0x00001000, // Variable declaration - Const = 0x00002000, // Variable declaration - OctalLiteral = 0x00004000, // Octal numeric literal - Namespace = 0x00008000, // Namespace declaration - ExportContext = 0x00010000, // Export context (initialized by binding) + Abstract = 0x00000100, + Default = 0x00000200, // Function/Class (export default declaration) + MultiLine = 0x00000400, // Multi-line array or object literal + Synthetic = 0x00000800, // Synthetic node (for full fidelity) + DeclarationFile = 0x00001000, // Node is a .d.ts file + Let = 0x00002000, // Variable declaration + Const = 0x00004000, // Variable declaration + OctalLiteral = 0x00008000, // Octal numeric literal + Namespace = 0x00010000, // Namespace declaration + ExportContext = 0x00020000, // Export context (initialized by binding) - Modifier = Export | Ambient | Public | Private | Protected | Static | Default, + Modifier = Export | Ambient | Public | Private | Protected | Static | Abstract | Default, AccessibilityModifier = Public | Private | Protected, BlockScoped = Let | Const } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 5296f063a94..7dd89e9d99e 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1141,6 +1141,7 @@ module ts { case SyntaxKind.PrivateKeyword: case SyntaxKind.ProtectedKeyword: case SyntaxKind.StaticKeyword: + case SyntaxKind.AbstractKeyword: case SyntaxKind.ExportKeyword: case SyntaxKind.DeclareKeyword: case SyntaxKind.ConstKeyword: @@ -1626,6 +1627,7 @@ module ts { case SyntaxKind.PublicKeyword: return NodeFlags.Public; case SyntaxKind.ProtectedKeyword: return NodeFlags.Protected; case SyntaxKind.PrivateKeyword: return NodeFlags.Private; + case SyntaxKind.AbstractKeyword: return NodeFlags.Abstract; case SyntaxKind.ExportKeyword: return NodeFlags.Export; case SyntaxKind.DeclareKeyword: return NodeFlags.Ambient; case SyntaxKind.ConstKeyword: return NodeFlags.Const;