From 2748a5b163cf53b08d71d2161f3e60a82dc1bd55 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 16 Dec 2014 23:00:14 -0800 Subject: [PATCH] Remove 'grammarDiagnostics' from SourceFile. --- src/compiler/parser.ts | 7 +++---- src/compiler/types.ts | 4 ---- src/harness/harness.ts | 1 - src/services/services.ts | 1 - 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index d4dc86dd89e..1cee0039568 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -13,7 +13,7 @@ module ts { export function createNode(kind: SyntaxKind): Node { return new (getNodeConstructor(kind))(); } - + // Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes // stored in properties. If a 'cbNodes' callback is specified, it is invoked for embedded arrays; otherwise, // embedded arrays are flattened and the 'cbNode' callback is invoked for each element. If a callback returns @@ -388,8 +388,8 @@ module ts { case ParsingContext.HeritageClauses: return Diagnostics.Unexpected_token_expected; } }; - - export function modifierToFlag(token: SyntaxKind): NodeFlags { + + export function modifierToFlag(token: SyntaxKind): NodeFlags { switch (token) { case SyntaxKind.StaticKeyword: return NodeFlags.Static; case SyntaxKind.PublicKeyword: return NodeFlags.Public; @@ -535,7 +535,6 @@ module ts { sourceFile.referenceDiagnostics = []; sourceFile.parseDiagnostics = []; - sourceFile.grammarDiagnostics = []; sourceFile.semanticDiagnostics = []; processReferenceComments(); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index f7e94beac6f..50cc2e5658c 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -890,10 +890,6 @@ module ts { // missing tokens, or tokens it didn't know how to deal with). parseDiagnostics: Diagnostic[]; - // Grammar errors are for things the parser understood, but either the ES6 or TS grammars - // do not allow (like putting an 'public' modifier on a 'class declaration'). - grammarDiagnostics: Diagnostic[]; - // Returns all syntactic diagnostics (i.e. the reference, parser and grammar diagnostics). getSyntacticDiagnostics(): Diagnostic[]; diff --git a/src/harness/harness.ts b/src/harness/harness.ts index ac98f51fe70..7e8acdab68d 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -263,7 +263,6 @@ module Utils { case "referenceDiagnostics": case "parseDiagnostics": - case "grammarDiagnostics": o[propertyName] = Utils.convertDiagnostics((n)[propertyName]); break; diff --git a/src/services/services.ts b/src/services/services.ts index 4f9dcaf1051..67c55a8c829 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -743,7 +743,6 @@ module ts { public referenceDiagnostics: Diagnostic[]; public parseDiagnostics: Diagnostic[]; - public grammarDiagnostics: Diagnostic[]; public semanticDiagnostics: Diagnostic[]; public hasNoDefaultLib: boolean;