Skip to content

Commit cc9bf13

Browse files
committed
Some cleanup and renaming
1 parent e4df03a commit cc9bf13

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/compiler/checker.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11195,7 +11195,6 @@ module ts {
1119511195
let inAmbientExternalModule = node.parent.kind === SyntaxKind.ModuleBlock && (<ModuleDeclaration>node.parent.parent).name.kind === SyntaxKind.StringLiteral;
1119611196
if (node.parent.kind !== SyntaxKind.SourceFile && !inAmbientExternalModule) {
1119711197
error(moduleName, node.kind === SyntaxKind.ExportDeclaration ?
11198-
// TODO: StatementFlags (clarify message)
1119911198
Diagnostics.Export_declarations_are_not_permitted_in_a_namespace :
1120011199
Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module);
1120111200
return false;

src/compiler/parser.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3804,7 +3804,7 @@ module ts {
38043804
return isIdentifierOrKeyword() && !scanner.hasPrecedingLineBreak();
38053805
}
38063806

3807-
function parseDeclarationFlags(): boolean {
3807+
function isDeclaration(): boolean {
38083808
while (true) {
38093809
switch (token) {
38103810
case SyntaxKind.VarKeyword:
@@ -3873,8 +3873,8 @@ module ts {
38733873
}
38743874
}
38753875

3876-
function getDeclarationFlags(): boolean {
3877-
return lookAhead(parseDeclarationFlags);
3876+
function isStartOfDeclaration(): boolean {
3877+
return lookAhead(isDeclaration);
38783878
}
38793879

38803880
function isStartOfStatement(): boolean {
@@ -3908,7 +3908,7 @@ module ts {
39083908
case SyntaxKind.ConstKeyword:
39093909
case SyntaxKind.ExportKeyword:
39103910
case SyntaxKind.ImportKeyword:
3911-
return getDeclarationFlags();
3911+
return isStartOfDeclaration();
39123912

39133913
case SyntaxKind.DeclareKeyword:
39143914
case SyntaxKind.InterfaceKeyword:
@@ -3924,7 +3924,7 @@ module ts {
39243924
case SyntaxKind.StaticKeyword:
39253925
// When these don't start a declaration, they may be the start of a class member if an identifier
39263926
// immediately follows. Otherwise they're an identifier in an expression statement.
3927-
return getDeclarationFlags() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine);
3927+
return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine);
39283928

39293929
default:
39303930
return isStartOfExpression();
@@ -4003,7 +4003,7 @@ module ts {
40034003
case SyntaxKind.ProtectedKeyword:
40044004
case SyntaxKind.PublicKeyword:
40054005
case SyntaxKind.StaticKeyword:
4006-
if (getDeclarationFlags()) {
4006+
if (isStartOfDeclaration()) {
40074007
return parseDeclaration();
40084008
}
40094009
break;

0 commit comments

Comments
 (0)