Skip to content

Commit af2dd5c

Browse files
Rename 'block' to 'body'.
Conflicts: src/services/syntax/SyntaxGenerator.js.map
1 parent 300862a commit af2dd5c

File tree

9 files changed

+55
-47
lines changed

9 files changed

+55
-47
lines changed

src/services/syntax/SyntaxGenerator.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/services/syntax/SyntaxGenerator.js.map

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/services/syntax/prettyPrinter.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ module TypeScript.PrettyPrinter {
698698
visitNodeOrToken(this, node.propertyName);
699699
visitNodeOrToken(this, node.callSignature);
700700
this.ensureSpace();
701-
visitNodeOrToken(this, node.block);
701+
visitNodeOrToken(this, node.body);
702702
}
703703

704704
public visitSetAccessor(node: SetAccessorSyntax): void {
@@ -709,7 +709,7 @@ module TypeScript.PrettyPrinter {
709709
visitNodeOrToken(this, node.propertyName);
710710
visitNodeOrToken(this, node.callSignature)
711711
this.ensureSpace();
712-
visitNodeOrToken(this, node.block);
712+
visitNodeOrToken(this, node.body);
713713
}
714714

715715
public visitMemberVariableDeclaration(node: MemberVariableDeclarationSyntax): void {
@@ -942,7 +942,7 @@ module TypeScript.PrettyPrinter {
942942
visitNodeOrToken(this, node.propertyName);
943943
visitNodeOrToken(this, node.callSignature);
944944
this.ensureSpace();
945-
visitNodeOrToken(this, node.block);
945+
visitNodeOrToken(this, node.body);
946946
}
947947

948948
public visitFunctionExpression(node: FunctionExpressionSyntax): void {
@@ -955,7 +955,7 @@ module TypeScript.PrettyPrinter {
955955

956956
visitNodeOrToken(this, node.callSignature);
957957
this.ensureSpace();
958-
visitNodeOrToken(this, node.block);
958+
visitNodeOrToken(this, node.body);
959959
}
960960

961961
public visitEmptyStatement(node: EmptyStatementSyntax): void {

src/services/syntax/syntaxElement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ module TypeScript {
435435
modifiers: ISyntaxToken[];
436436
propertyName: IPropertyNameSyntax;
437437
callSignature: CallSignatureSyntax;
438-
block: BlockSyntax | ExpressionBody | ISyntaxToken;
438+
body: BlockSyntax | ExpressionBody | ISyntaxToken;
439439
}
440440

441441
export interface ISwitchClauseSyntax extends ISyntaxNode {

src/services/syntax/syntaxGenerator.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ var definitions:ITypeDefinition[] = [
670670
<any>{ name: 'getKeyword', isToken: true, excludeFromAST: true },
671671
<any>{ name: 'propertyName', type: 'IPropertyNameSyntax' },
672672
<any>{ name: 'callSignature', type: 'CallSignatureSyntax' },
673-
<any>{ name: 'block', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true }
673+
<any>{ name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true }
674674
]
675675
},
676676
<any>{
@@ -682,7 +682,7 @@ var definitions:ITypeDefinition[] = [
682682
<any>{ name: 'setKeyword', isToken: true, excludeFromAST: true },
683683
<any>{ name: 'propertyName', type: 'IPropertyNameSyntax' },
684684
<any>{ name: 'callSignature', type: 'CallSignatureSyntax' },
685-
<any>{ name: 'block', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true }
685+
<any>{ name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true }
686686
],
687687
isTypeScriptSpecific: true
688688
},
@@ -919,7 +919,7 @@ var definitions:ITypeDefinition[] = [
919919
<any>{ name: 'asterixToken', isToken: true, isOptional: true },
920920
<any>{ name: 'propertyName', type: 'IPropertyNameSyntax' },
921921
<any>{ name: 'callSignature', type: 'CallSignatureSyntax' },
922-
<any>{ name: 'block', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true }
922+
<any>{ name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true }
923923
]
924924
},
925925
<any>{
@@ -931,7 +931,7 @@ var definitions:ITypeDefinition[] = [
931931
<any>{ name: 'asterixToken', isToken: true, isOptional: true },
932932
<any>{ name: 'identifier', isToken: true, isOptional: true },
933933
<any>{ name: 'callSignature', type: 'CallSignatureSyntax' },
934-
<any>{ name: 'block', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true }]
934+
<any>{ name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true }]
935935
},
936936
<any>{
937937
name: 'EmptyStatementSyntax',

src/services/syntax/syntaxInterfaces.generated.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,18 +185,18 @@ module TypeScript {
185185
getKeyword: ISyntaxToken;
186186
propertyName: IPropertyNameSyntax;
187187
callSignature: CallSignatureSyntax;
188-
block: BlockSyntax | ExpressionBody | ISyntaxToken;
188+
body: BlockSyntax | ExpressionBody | ISyntaxToken;
189189
}
190-
export interface GetAccessorConstructor { new (data: number, modifiers: ISyntaxToken[], getKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax | ExpressionBody | ISyntaxToken): GetAccessorSyntax }
190+
export interface GetAccessorConstructor { new (data: number, modifiers: ISyntaxToken[], getKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken): GetAccessorSyntax }
191191

192192
export interface SetAccessorSyntax extends ISyntaxNode, IAccessorSyntax {
193193
modifiers: ISyntaxToken[];
194194
setKeyword: ISyntaxToken;
195195
propertyName: IPropertyNameSyntax;
196196
callSignature: CallSignatureSyntax;
197-
block: BlockSyntax | ExpressionBody | ISyntaxToken;
197+
body: BlockSyntax | ExpressionBody | ISyntaxToken;
198198
}
199-
export interface SetAccessorConstructor { new (data: number, modifiers: ISyntaxToken[], setKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax | ExpressionBody | ISyntaxToken): SetAccessorSyntax }
199+
export interface SetAccessorConstructor { new (data: number, modifiers: ISyntaxToken[], setKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken): SetAccessorSyntax }
200200

201201
export interface PropertySignatureSyntax extends ISyntaxNode, ITypeMemberSyntax {
202202
propertyName: IPropertyNameSyntax;
@@ -504,9 +504,9 @@ module TypeScript {
504504
asterixToken: ISyntaxToken;
505505
identifier: ISyntaxToken;
506506
callSignature: CallSignatureSyntax;
507-
block: BlockSyntax | ExpressionBody | ISyntaxToken;
507+
body: BlockSyntax | ExpressionBody | ISyntaxToken;
508508
}
509-
export interface FunctionExpressionConstructor { new (data: number, functionKeyword: ISyntaxToken, asterixToken: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax | ExpressionBody | ISyntaxToken): FunctionExpressionSyntax }
509+
export interface FunctionExpressionConstructor { new (data: number, functionKeyword: ISyntaxToken, asterixToken: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken): FunctionExpressionSyntax }
510510

511511
export interface OmittedExpressionSyntax extends ISyntaxNode, IExpressionSyntax {
512512
}
@@ -651,9 +651,9 @@ module TypeScript {
651651
asterixToken: ISyntaxToken;
652652
propertyName: IPropertyNameSyntax;
653653
callSignature: CallSignatureSyntax;
654-
block: BlockSyntax | ExpressionBody | ISyntaxToken;
654+
body: BlockSyntax | ExpressionBody | ISyntaxToken;
655655
}
656-
export interface FunctionPropertyAssignmentConstructor { new (data: number, asterixToken: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax | ExpressionBody | ISyntaxToken): FunctionPropertyAssignmentSyntax }
656+
export interface FunctionPropertyAssignmentConstructor { new (data: number, asterixToken: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken): FunctionPropertyAssignmentSyntax }
657657

658658
export interface ParameterSyntax extends ISyntaxNode {
659659
dotDotDotToken: ISyntaxToken;

src/services/syntax/syntaxNodes.concrete.generated.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -491,18 +491,18 @@ module TypeScript {
491491
}
492492
}
493493

494-
export var GetAccessorSyntax: GetAccessorConstructor = <any>function(data: number, modifiers: ISyntaxToken[], getKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax | ExpressionBody | ISyntaxToken) {
494+
export var GetAccessorSyntax: GetAccessorConstructor = <any>function(data: number, modifiers: ISyntaxToken[], getKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken) {
495495
if (data) { this.__data = data; }
496496
this.modifiers = modifiers,
497497
this.getKeyword = getKeyword,
498498
this.propertyName = propertyName,
499499
this.callSignature = callSignature,
500-
this.block = block,
500+
this.body = body,
501501
modifiers.parent = this,
502502
getKeyword.parent = this,
503503
propertyName.parent = this,
504504
callSignature.parent = this,
505-
block && (block.parent = this);
505+
body && (body.parent = this);
506506
};
507507
GetAccessorSyntax.prototype.kind = SyntaxKind.GetAccessor;
508508
GetAccessorSyntax.prototype.childCount = 5;
@@ -512,22 +512,22 @@ module TypeScript {
512512
case 1: return this.getKeyword;
513513
case 2: return this.propertyName;
514514
case 3: return this.callSignature;
515-
case 4: return this.block;
515+
case 4: return this.body;
516516
}
517517
}
518518

519-
export var SetAccessorSyntax: SetAccessorConstructor = <any>function(data: number, modifiers: ISyntaxToken[], setKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax | ExpressionBody | ISyntaxToken) {
519+
export var SetAccessorSyntax: SetAccessorConstructor = <any>function(data: number, modifiers: ISyntaxToken[], setKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken) {
520520
if (data) { this.__data = data; }
521521
this.modifiers = modifiers,
522522
this.setKeyword = setKeyword,
523523
this.propertyName = propertyName,
524524
this.callSignature = callSignature,
525-
this.block = block,
525+
this.body = body,
526526
modifiers.parent = this,
527527
setKeyword.parent = this,
528528
propertyName.parent = this,
529529
callSignature.parent = this,
530-
block && (block.parent = this);
530+
body && (body.parent = this);
531531
};
532532
SetAccessorSyntax.prototype.kind = SyntaxKind.SetAccessor;
533533
SetAccessorSyntax.prototype.childCount = 5;
@@ -537,7 +537,7 @@ module TypeScript {
537537
case 1: return this.setKeyword;
538538
case 2: return this.propertyName;
539539
case 3: return this.callSignature;
540-
case 4: return this.block;
540+
case 4: return this.body;
541541
}
542542
}
543543

@@ -1364,18 +1364,18 @@ module TypeScript {
13641364
}
13651365
}
13661366

1367-
export var FunctionExpressionSyntax: FunctionExpressionConstructor = <any>function(data: number, functionKeyword: ISyntaxToken, asterixToken: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax | ExpressionBody | ISyntaxToken) {
1367+
export var FunctionExpressionSyntax: FunctionExpressionConstructor = <any>function(data: number, functionKeyword: ISyntaxToken, asterixToken: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken) {
13681368
if (data) { this.__data = data; }
13691369
this.functionKeyword = functionKeyword,
13701370
this.asterixToken = asterixToken,
13711371
this.identifier = identifier,
13721372
this.callSignature = callSignature,
1373-
this.block = block,
1373+
this.body = body,
13741374
functionKeyword.parent = this,
13751375
asterixToken && (asterixToken.parent = this),
13761376
identifier && (identifier.parent = this),
13771377
callSignature.parent = this,
1378-
block && (block.parent = this);
1378+
body && (body.parent = this);
13791379
};
13801380
FunctionExpressionSyntax.prototype.kind = SyntaxKind.FunctionExpression;
13811381
FunctionExpressionSyntax.prototype.childCount = 5;
@@ -1385,7 +1385,7 @@ module TypeScript {
13851385
case 1: return this.asterixToken;
13861386
case 2: return this.identifier;
13871387
case 3: return this.callSignature;
1388-
case 4: return this.block;
1388+
case 4: return this.body;
13891389
}
13901390
}
13911391

@@ -1763,16 +1763,16 @@ module TypeScript {
17631763
}
17641764
}
17651765

1766-
export var FunctionPropertyAssignmentSyntax: FunctionPropertyAssignmentConstructor = <any>function(data: number, asterixToken: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax | ExpressionBody | ISyntaxToken) {
1766+
export var FunctionPropertyAssignmentSyntax: FunctionPropertyAssignmentConstructor = <any>function(data: number, asterixToken: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken) {
17671767
if (data) { this.__data = data; }
17681768
this.asterixToken = asterixToken,
17691769
this.propertyName = propertyName,
17701770
this.callSignature = callSignature,
1771-
this.block = block,
1771+
this.body = body,
17721772
asterixToken && (asterixToken.parent = this),
17731773
propertyName.parent = this,
17741774
callSignature.parent = this,
1775-
block && (block.parent = this);
1775+
body && (body.parent = this);
17761776
};
17771777
FunctionPropertyAssignmentSyntax.prototype.kind = SyntaxKind.FunctionPropertyAssignment;
17781778
FunctionPropertyAssignmentSyntax.prototype.childCount = 4;
@@ -1781,7 +1781,7 @@ module TypeScript {
17811781
case 0: return this.asterixToken;
17821782
case 1: return this.propertyName;
17831783
case 2: return this.callSignature;
1784-
case 3: return this.block;
1784+
case 3: return this.body;
17851785
}
17861786
}
17871787

src/services/syntax/syntaxTree.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -636,15 +636,19 @@ module TypeScript {
636636
this.checkForDisallowedAccessorTypeParameters(node.callSignature) ||
637637
this.checkGetAccessorParameter(node) ||
638638
this.checkForDisallowedTemplatePropertyName(node.propertyName) ||
639-
this.checkForSemicolonInsteadOfBlock(node.block)) {
639+
this.checkForSemicolonInsteadOfBlock(node, node.body)) {
640640
return;
641641
}
642642

643643
super.visitGetAccessor(node);
644644
}
645645

646-
private checkForSemicolonInsteadOfBlock(node: BlockSyntax | ExpressionBody | ISyntaxToken): boolean {
647-
if (node.kind === SyntaxKind.SemicolonToken) {
646+
private checkForSemicolonInsteadOfBlock(parent: ISyntaxNode, node: BlockSyntax | ExpressionBody | ISyntaxToken): boolean {
647+
if (node === undefined) {
648+
this.pushDiagnosticAt(fullEnd(parent), 0, DiagnosticCode._0_expected, ["{"]);
649+
return true;
650+
}
651+
else if (node.kind === SyntaxKind.SemicolonToken) {
648652
this.pushDiagnostic(node, DiagnosticCode._0_expected, ["{"]);
649653
return true;
650654
}
@@ -723,7 +727,7 @@ module TypeScript {
723727
this.checkForDisallowedSetAccessorTypeAnnotation(node) ||
724728
this.checkSetAccessorParameter(node) ||
725729
this.checkForDisallowedTemplatePropertyName(node.propertyName) ||
726-
this.checkForSemicolonInsteadOfBlock(node.block)) {
730+
this.checkForSemicolonInsteadOfBlock(node, node.body)) {
727731
return;
728732
}
729733

@@ -1401,7 +1405,7 @@ module TypeScript {
14011405

14021406
public visitFunctionExpression(node: FunctionExpressionSyntax): void {
14031407
if (this.checkForDisallowedEvalOrArguments(node, node.identifier) ||
1404-
this.checkForSemicolonInsteadOfBlock(node.block)) {
1408+
this.checkForSemicolonInsteadOfBlock(node, node.body)) {
14051409
return;
14061410
}
14071411

@@ -1410,7 +1414,7 @@ module TypeScript {
14101414

14111415
public visitFunctionPropertyAssignment(node: FunctionPropertyAssignmentSyntax): void {
14121416
if (this.checkForDisallowedTemplatePropertyName(node.propertyName) ||
1413-
this.checkForSemicolonInsteadOfBlock(node.block)) {
1417+
this.checkForSemicolonInsteadOfBlock(node, node.body)) {
14141418
return;
14151419
}
14161420

src/services/syntax/syntaxWalker.generated.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,15 @@ module TypeScript {
180180
this.visitToken(node.getKeyword);
181181
visitNodeOrToken(this, node.propertyName);
182182
visitNodeOrToken(this, node.callSignature);
183-
visitNodeOrToken(this, node.block);
183+
visitNodeOrToken(this, node.body);
184184
}
185185

186186
public visitSetAccessor(node: SetAccessorSyntax): void {
187187
this.visitList(node.modifiers);
188188
this.visitToken(node.setKeyword);
189189
visitNodeOrToken(this, node.propertyName);
190190
visitNodeOrToken(this, node.callSignature);
191-
visitNodeOrToken(this, node.block);
191+
visitNodeOrToken(this, node.body);
192192
}
193193

194194
public visitPropertySignature(node: PropertySignatureSyntax): void {
@@ -457,7 +457,7 @@ module TypeScript {
457457
this.visitOptionalToken(node.asterixToken);
458458
this.visitOptionalToken(node.identifier);
459459
visitNodeOrToken(this, node.callSignature);
460-
visitNodeOrToken(this, node.block);
460+
visitNodeOrToken(this, node.body);
461461
}
462462

463463
public visitOmittedExpression(node: OmittedExpressionSyntax): void {
@@ -582,7 +582,7 @@ module TypeScript {
582582
this.visitOptionalToken(node.asterixToken);
583583
visitNodeOrToken(this, node.propertyName);
584584
visitNodeOrToken(this, node.callSignature);
585-
visitNodeOrToken(this, node.block);
585+
visitNodeOrToken(this, node.body);
586586
}
587587

588588
public visitParameter(node: ParameterSyntax): void {

0 commit comments

Comments
 (0)