Rename SimplePropertyAssignment to PropertyAssignment.

Conflicts:
	src/services/syntax/SyntaxGenerator.js.map
This commit is contained in:
Cyrus Najmabadi 2014-11-25 19:32:55 -08:00
parent 7c0eb2679b
commit 2233a01fb3
11 changed files with 27 additions and 20 deletions

View file

@ -624,7 +624,7 @@ var TypeScript;
SyntaxKind[SyntaxKind["TypeAnnotation"] = 212] = "TypeAnnotation";
SyntaxKind[SyntaxKind["ExpressionBody"] = 213] = "ExpressionBody";
SyntaxKind[SyntaxKind["ComputedPropertyName"] = 214] = "ComputedPropertyName";
SyntaxKind[SyntaxKind["SimplePropertyAssignment"] = 215] = "SimplePropertyAssignment";
SyntaxKind[SyntaxKind["PropertyAssignment"] = 215] = "PropertyAssignment";
SyntaxKind[SyntaxKind["ExternalModuleReference"] = 216] = "ExternalModuleReference";
SyntaxKind[SyntaxKind["ModuleNameModuleReference"] = 217] = "ModuleNameModuleReference";
SyntaxKind[SyntaxKind["FirstStandardKeyword"] = SyntaxKind.BreakKeyword] = "FirstStandardKeyword";
@ -1762,7 +1762,7 @@ var definitions = [
]
},
{
name: 'SimplePropertyAssignmentSyntax',
name: 'PropertyAssignmentSyntax',
baseType: 'ISyntaxNode',
interfaces: ['IPropertyAssignmentSyntax'],
children: [

File diff suppressed because one or more lines are too long

View file

@ -3619,9 +3619,12 @@ module TypeScript.Parser {
if (_currentToken.kind === SyntaxKind.AsyncKeyword) {
// 'async' might start an asynchronous property, or it might just be the name
// of a property.
if (peekToken(1).kind === SyntaxKind.AsteriskToken || isPropertyName(/*peekIndex:*/ 1, inErrorRecovery)) {
return parseMemberFunctionDeclaration(
Syntax.list([eatToken(SyntaxKind.AsyncKeyword)]), tryEatToken(SyntaxKind.AsteriskToken), parsePropertyName());
var token1 = peekToken(1);
if (!token1.hasLeadingNewLine()) {
if (token1.kind === SyntaxKind.AsteriskToken || isPropertyName(/*peekIndex:*/ 1, inErrorRecovery)) {
return parseMemberFunctionDeclaration(
Syntax.list([eatToken(SyntaxKind.AsyncKeyword)]), tryEatToken(SyntaxKind.AsteriskToken), parsePropertyName());
}
}
}
@ -3669,7 +3672,7 @@ module TypeScript.Parser {
//
// Also, if we have an identifier and it is followed by a colon then this is
// definitely a simple property assignment.
return new SimplePropertyAssignmentSyntax(contextFlags,
return new PropertyAssignmentSyntax(contextFlags,
propertyName,
eatToken(SyntaxKind.ColonToken),
allowInAnd(parseAssignmentExpressionOrHigher));

View file

@ -931,7 +931,7 @@ module TypeScript.PrettyPrinter {
this.appendToken(node.closeBracketToken);
}
public visitSimplePropertyAssignment(node: SimplePropertyAssignmentSyntax): void {
public visitPropertyAssignment(node: PropertyAssignmentSyntax): void {
visitNodeOrToken(this, node.propertyName);
this.appendToken(node.colonToken);
this.ensureSpace();

View file

@ -904,7 +904,7 @@ var definitions:ITypeDefinition[] = [
]
},
<any>{
name: 'SimplePropertyAssignmentSyntax',
name: 'PropertyAssignmentSyntax',
baseType: 'ISyntaxNode',
interfaces: ['IPropertyAssignmentSyntax'],
children: [

View file

@ -684,12 +684,12 @@ module TypeScript {
}
export interface ComputedPropertyNameConstructor { new (data: number, openBracketToken: ISyntaxToken, expression: IExpressionSyntax, closeBracketToken: ISyntaxToken): ComputedPropertyNameSyntax }
export interface SimplePropertyAssignmentSyntax extends ISyntaxNode, IPropertyAssignmentSyntax {
export interface PropertyAssignmentSyntax extends ISyntaxNode, IPropertyAssignmentSyntax {
propertyName: IPropertyNameSyntax;
colonToken: ISyntaxToken;
expression: IExpressionSyntax;
}
export interface SimplePropertyAssignmentConstructor { new (data: number, propertyName: IPropertyNameSyntax, colonToken: ISyntaxToken, expression: IExpressionSyntax): SimplePropertyAssignmentSyntax }
export interface PropertyAssignmentConstructor { new (data: number, propertyName: IPropertyNameSyntax, colonToken: ISyntaxToken, expression: IExpressionSyntax): PropertyAssignmentSyntax }
export interface ExternalModuleReferenceSyntax extends ISyntaxNode, IModuleReferenceSyntax {
requireKeyword: ISyntaxToken;

View file

@ -269,7 +269,7 @@ module TypeScript {
TypeAnnotation,
ExpressionBody,
ComputedPropertyName,
SimplePropertyAssignment,
PropertyAssignment,
ExternalModuleReference,
ModuleNameModuleReference,

View file

@ -1864,7 +1864,7 @@ module TypeScript {
}
}
export var SimplePropertyAssignmentSyntax: SimplePropertyAssignmentConstructor = <any>function(data: number, propertyName: IPropertyNameSyntax, colonToken: ISyntaxToken, expression: IExpressionSyntax) {
export var PropertyAssignmentSyntax: PropertyAssignmentConstructor = <any>function(data: number, propertyName: IPropertyNameSyntax, colonToken: ISyntaxToken, expression: IExpressionSyntax) {
if (data) { this.__data = data; }
this.propertyName = propertyName,
this.colonToken = colonToken,
@ -1873,9 +1873,9 @@ module TypeScript {
colonToken.parent = this,
expression.parent = this;
};
SimplePropertyAssignmentSyntax.prototype.kind = SyntaxKind.SimplePropertyAssignment;
SimplePropertyAssignmentSyntax.prototype.childCount = 3;
SimplePropertyAssignmentSyntax.prototype.childAt = function(index: number): ISyntaxElement {
PropertyAssignmentSyntax.prototype.kind = SyntaxKind.PropertyAssignment;
PropertyAssignmentSyntax.prototype.childCount = 3;
PropertyAssignmentSyntax.prototype.childAt = function(index: number): ISyntaxElement {
switch (index) {
case 0: return this.propertyName;
case 1: return this.colonToken;

View file

@ -751,12 +751,12 @@ module TypeScript {
super.visitSimpleArrowFunctionExpression(node);
}
public visitSimplePropertyAssignment(node: SimplePropertyAssignmentSyntax): void {
public visitPropertyAssignment(node: PropertyAssignmentSyntax): void {
if (this.checkForDisallowedTemplatePropertyName(node.propertyName)) {
return;
}
super.visitSimplePropertyAssignment(node);
super.visitPropertyAssignment(node);
}
public visitSetAccessor(node: SetAccessorSyntax): void {

View file

@ -95,7 +95,7 @@ module TypeScript {
case SyntaxKind.TypeAnnotation: return visitor.visitTypeAnnotation(<TypeAnnotationSyntax>element);
case SyntaxKind.ExpressionBody: return visitor.visitExpressionBody(<ExpressionBody>element);
case SyntaxKind.ComputedPropertyName: return visitor.visitComputedPropertyName(<ComputedPropertyNameSyntax>element);
case SyntaxKind.SimplePropertyAssignment: return visitor.visitSimplePropertyAssignment(<SimplePropertyAssignmentSyntax>element);
case SyntaxKind.PropertyAssignment: return visitor.visitPropertyAssignment(<PropertyAssignmentSyntax>element);
case SyntaxKind.ExternalModuleReference: return visitor.visitExternalModuleReference(<ExternalModuleReferenceSyntax>element);
case SyntaxKind.ModuleNameModuleReference: return visitor.visitModuleNameModuleReference(<ModuleNameModuleReferenceSyntax>element);
default: return visitor.visitToken(<ISyntaxToken>element);
@ -195,7 +195,7 @@ module TypeScript {
visitTypeAnnotation(node: TypeAnnotationSyntax): any;
visitExpressionBody(node: ExpressionBody): any;
visitComputedPropertyName(node: ComputedPropertyNameSyntax): any;
visitSimplePropertyAssignment(node: SimplePropertyAssignmentSyntax): any;
visitPropertyAssignment(node: PropertyAssignmentSyntax): any;
visitExternalModuleReference(node: ExternalModuleReferenceSyntax): any;
visitModuleNameModuleReference(node: ModuleNameModuleReferenceSyntax): any;
}

View file

@ -610,7 +610,7 @@ module TypeScript {
this.visitToken(node.closeBracketToken);
}
public visitSimplePropertyAssignment(node: SimplePropertyAssignmentSyntax): void {
public visitPropertyAssignment(node: PropertyAssignmentSyntax): void {
visitNodeOrToken(this, node.propertyName);
this.visitToken(node.colonToken);
visitNodeOrToken(this, node.expression);