|
|
|
@ -1,4 +1,4 @@ |
|
|
|
//
|
|
|
|
//
|
|
|
|
// CSharpParser.cs
|
|
|
|
// CSharpParser.cs
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Author:
|
|
|
|
// Author:
|
|
|
|
@ -126,7 +126,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
|
|
|
|
|
|
|
|
var memberType = new MemberType (); |
|
|
|
var memberType = new MemberType (); |
|
|
|
memberType.AddChild (ConvertToType (ma.LeftExpression), MemberType.TargetRole); |
|
|
|
memberType.AddChild (ConvertToType (ma.LeftExpression), MemberType.TargetRole); |
|
|
|
memberType.MemberNameToken = new Identifier (ma.Name, Convert (ma.Location)); |
|
|
|
memberType.MemberNameToken = Identifier.Create (ma.Name, Convert (ma.Location)); |
|
|
|
|
|
|
|
|
|
|
|
AddTypeArguments (ma, memberType); |
|
|
|
AddTypeArguments (ma, memberType); |
|
|
|
return memberType; |
|
|
|
return memberType; |
|
|
|
@ -257,7 +257,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
{ |
|
|
|
{ |
|
|
|
AstNode insertPos = null; |
|
|
|
AstNode insertPos = null; |
|
|
|
while (memberName != null) { |
|
|
|
while (memberName != null) { |
|
|
|
Identifier newIdent = new Identifier (memberName.Name, Convert (memberName.Location)); |
|
|
|
Identifier newIdent = Identifier.Create (memberName.Name, Convert (memberName.Location)); |
|
|
|
namespaceDecl.InsertChildBefore (insertPos, newIdent, NamespaceDeclaration.Roles.Identifier); |
|
|
|
namespaceDecl.InsertChildBefore (insertPos, newIdent, NamespaceDeclaration.Roles.Identifier); |
|
|
|
insertPos = newIdent; |
|
|
|
insertPos = newIdent; |
|
|
|
memberName = memberName.Left; |
|
|
|
memberName = memberName.Left; |
|
|
|
@ -277,7 +277,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
{ |
|
|
|
{ |
|
|
|
UsingAliasDeclaration ud = new UsingAliasDeclaration (); |
|
|
|
UsingAliasDeclaration ud = new UsingAliasDeclaration (); |
|
|
|
ud.AddChild (new CSharpTokenNode (Convert (u.UsingLocation), "using".Length), UsingAliasDeclaration.Roles.Keyword); |
|
|
|
ud.AddChild (new CSharpTokenNode (Convert (u.UsingLocation), "using".Length), UsingAliasDeclaration.Roles.Keyword); |
|
|
|
ud.AddChild (new Identifier (u.Identifier.Value, Convert (u.Identifier.Location)), UsingAliasDeclaration.AliasRole); |
|
|
|
ud.AddChild (Identifier.Create (u.Identifier.Value, Convert (u.Identifier.Location)), UsingAliasDeclaration.AliasRole); |
|
|
|
ud.AddChild (new CSharpTokenNode (Convert (u.AssignLocation), 1), UsingAliasDeclaration.Roles.Assign); |
|
|
|
ud.AddChild (new CSharpTokenNode (Convert (u.AssignLocation), 1), UsingAliasDeclaration.Roles.Assign); |
|
|
|
ud.AddChild (ConvertImport (u.Nspace), UsingAliasDeclaration.ImportRole); |
|
|
|
ud.AddChild (ConvertImport (u.Nspace), UsingAliasDeclaration.ImportRole); |
|
|
|
ud.AddChild (new CSharpTokenNode (Convert (u.SemicolonLocation), 1), UsingAliasDeclaration.Roles.Semicolon); |
|
|
|
ud.AddChild (new CSharpTokenNode (Convert (u.SemicolonLocation), 1), UsingAliasDeclaration.Roles.Semicolon); |
|
|
|
@ -289,7 +289,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
var ud = new ExternAliasDeclaration (); |
|
|
|
var ud = new ExternAliasDeclaration (); |
|
|
|
ud.AddChild (new CSharpTokenNode (Convert (u.ExternLocation), "extern".Length), ExternAliasDeclaration.Roles.Keyword); |
|
|
|
ud.AddChild (new CSharpTokenNode (Convert (u.ExternLocation), "extern".Length), ExternAliasDeclaration.Roles.Keyword); |
|
|
|
ud.AddChild (new CSharpTokenNode (Convert (u.AliasLocation), "alias".Length), ExternAliasDeclaration.AliasRole); |
|
|
|
ud.AddChild (new CSharpTokenNode (Convert (u.AliasLocation), "alias".Length), ExternAliasDeclaration.AliasRole); |
|
|
|
ud.AddChild (new Identifier (u.Identifier.Value, Convert (u.Identifier.Location)), ExternAliasDeclaration.Roles.Identifier); |
|
|
|
ud.AddChild (Identifier.Create (u.Identifier.Value, Convert (u.Identifier.Location)), ExternAliasDeclaration.Roles.Identifier); |
|
|
|
ud.AddChild (new CSharpTokenNode (Convert (u.SemicolonLocation), 1), UsingAliasDeclaration.Roles.Semicolon); |
|
|
|
ud.AddChild (new CSharpTokenNode (Convert (u.SemicolonLocation), 1), UsingAliasDeclaration.Roles.Semicolon); |
|
|
|
AddToNamespace (ud); |
|
|
|
AddToNamespace (ud); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -301,12 +301,12 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
var t = new MemberType(); |
|
|
|
var t = new MemberType(); |
|
|
|
t.IsDoubleColon = memberName.IsDoubleColon; |
|
|
|
t.IsDoubleColon = memberName.IsDoubleColon; |
|
|
|
t.AddChild (ConvertImport (memberName.Left), MemberType.TargetRole); |
|
|
|
t.AddChild (ConvertImport (memberName.Left), MemberType.TargetRole); |
|
|
|
t.AddChild (new Identifier (memberName.Name, Convert(memberName.Location)), MemberType.Roles.Identifier); |
|
|
|
t.AddChild (Identifier.Create (memberName.Name, Convert(memberName.Location)), MemberType.Roles.Identifier); |
|
|
|
AddTypeArguments (t, (List<Location>)null, memberName.TypeArguments); |
|
|
|
AddTypeArguments (t, (List<Location>)null, memberName.TypeArguments); |
|
|
|
return t; |
|
|
|
return t; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
SimpleType t = new SimpleType(); |
|
|
|
SimpleType t = new SimpleType(); |
|
|
|
t.AddChild (new Identifier (memberName.Name, Convert(memberName.Location)), SimpleType.Roles.Identifier); |
|
|
|
t.AddChild (Identifier.Create (memberName.Name, Convert(memberName.Location)), SimpleType.Roles.Identifier); |
|
|
|
AddTypeArguments (t, (List<Location>)null, memberName.TypeArguments); |
|
|
|
AddTypeArguments (t, (List<Location>)null, memberName.TypeArguments); |
|
|
|
return t; |
|
|
|
return t; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -330,7 +330,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
AddModifiers (newType, location); |
|
|
|
AddModifiers (newType, location); |
|
|
|
if (location != null) |
|
|
|
if (location != null) |
|
|
|
newType.AddChild (new CSharpTokenNode (Convert (location[0]), "class".Length), TypeDeclaration.Roles.Keyword); |
|
|
|
newType.AddChild (new CSharpTokenNode (Convert (location[0]), "class".Length), TypeDeclaration.Roles.Keyword); |
|
|
|
newType.AddChild (new Identifier (c.MemberName.Name, Convert (c.MemberName.Location)), AstNode.Roles.Identifier); |
|
|
|
newType.AddChild (Identifier.Create (c.MemberName.Name, Convert (c.MemberName.Location)), AstNode.Roles.Identifier); |
|
|
|
if (c.MemberName.TypeArguments != null) { |
|
|
|
if (c.MemberName.TypeArguments != null) { |
|
|
|
var typeArgLocation = LocationsBag.GetLocations (c.MemberName); |
|
|
|
var typeArgLocation = LocationsBag.GetLocations (c.MemberName); |
|
|
|
if (typeArgLocation != null) |
|
|
|
if (typeArgLocation != null) |
|
|
|
@ -364,7 +364,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
AddModifiers (newType, location); |
|
|
|
AddModifiers (newType, location); |
|
|
|
if (location != null) |
|
|
|
if (location != null) |
|
|
|
newType.AddChild (new CSharpTokenNode (Convert (location[0]), "struct".Length), TypeDeclaration.Roles.Keyword); |
|
|
|
newType.AddChild (new CSharpTokenNode (Convert (location[0]), "struct".Length), TypeDeclaration.Roles.Keyword); |
|
|
|
newType.AddChild (new Identifier (s.MemberName.Name, Convert (s.MemberName.Location)), AstNode.Roles.Identifier); |
|
|
|
newType.AddChild (Identifier.Create (s.MemberName.Name, Convert (s.MemberName.Location)), AstNode.Roles.Identifier); |
|
|
|
if (s.MemberName.TypeArguments != null) { |
|
|
|
if (s.MemberName.TypeArguments != null) { |
|
|
|
var typeArgLocation = LocationsBag.GetLocations (s.MemberName); |
|
|
|
var typeArgLocation = LocationsBag.GetLocations (s.MemberName); |
|
|
|
if (typeArgLocation != null) |
|
|
|
if (typeArgLocation != null) |
|
|
|
@ -400,7 +400,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
AddModifiers (newType, location); |
|
|
|
AddModifiers (newType, location); |
|
|
|
if (location != null) |
|
|
|
if (location != null) |
|
|
|
newType.AddChild (new CSharpTokenNode (Convert (location[0]), "interface".Length), TypeDeclaration.Roles.Keyword); |
|
|
|
newType.AddChild (new CSharpTokenNode (Convert (location[0]), "interface".Length), TypeDeclaration.Roles.Keyword); |
|
|
|
newType.AddChild (new Identifier (i.MemberName.Name, Convert (i.MemberName.Location)), AstNode.Roles.Identifier); |
|
|
|
newType.AddChild (Identifier.Create (i.MemberName.Name, Convert (i.MemberName.Location)), AstNode.Roles.Identifier); |
|
|
|
if (i.MemberName.TypeArguments != null) { |
|
|
|
if (i.MemberName.TypeArguments != null) { |
|
|
|
var typeArgLocation = LocationsBag.GetLocations (i.MemberName); |
|
|
|
var typeArgLocation = LocationsBag.GetLocations (i.MemberName); |
|
|
|
if (typeArgLocation != null) |
|
|
|
if (typeArgLocation != null) |
|
|
|
@ -434,7 +434,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
if (location != null) |
|
|
|
if (location != null) |
|
|
|
newDelegate.AddChild (new CSharpTokenNode (Convert (location[0]), "delegate".Length), TypeDeclaration.Roles.Keyword); |
|
|
|
newDelegate.AddChild (new CSharpTokenNode (Convert (location[0]), "delegate".Length), TypeDeclaration.Roles.Keyword); |
|
|
|
newDelegate.AddChild (ConvertToType (d.ReturnType), AstNode.Roles.Type); |
|
|
|
newDelegate.AddChild (ConvertToType (d.ReturnType), AstNode.Roles.Type); |
|
|
|
newDelegate.AddChild (new Identifier (d.MemberName.Name, Convert (d.MemberName.Location)), AstNode.Roles.Identifier); |
|
|
|
newDelegate.AddChild (Identifier.Create (d.MemberName.Name, Convert (d.MemberName.Location)), AstNode.Roles.Identifier); |
|
|
|
if (d.MemberName.TypeArguments != null) { |
|
|
|
if (d.MemberName.TypeArguments != null) { |
|
|
|
var typeArgLocation = LocationsBag.GetLocations (d.MemberName); |
|
|
|
var typeArgLocation = LocationsBag.GetLocations (d.MemberName); |
|
|
|
if (typeArgLocation != null) |
|
|
|
if (typeArgLocation != null) |
|
|
|
@ -483,7 +483,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
AddModifiers (newType, location); |
|
|
|
AddModifiers (newType, location); |
|
|
|
if (location != null) |
|
|
|
if (location != null) |
|
|
|
newType.AddChild (new CSharpTokenNode (Convert (location [0]), "enum".Length), TypeDeclaration.Roles.Keyword); |
|
|
|
newType.AddChild (new CSharpTokenNode (Convert (location [0]), "enum".Length), TypeDeclaration.Roles.Keyword); |
|
|
|
newType.AddChild (new Identifier (e.MemberName.Name, Convert (e.MemberName.Location)), AstNode.Roles.Identifier); |
|
|
|
newType.AddChild (Identifier.Create (e.MemberName.Name, Convert (e.MemberName.Location)), AstNode.Roles.Identifier); |
|
|
|
|
|
|
|
|
|
|
|
if (e.BaseTypeExpression != null) |
|
|
|
if (e.BaseTypeExpression != null) |
|
|
|
newType.AddChild (ConvertToType (e.BaseTypeExpression), TypeDeclaration.BaseTypeRole); |
|
|
|
newType.AddChild (ConvertToType (e.BaseTypeExpression), TypeDeclaration.BaseTypeRole); |
|
|
|
@ -502,7 +502,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
{ |
|
|
|
{ |
|
|
|
EnumMemberDeclaration newField = new EnumMemberDeclaration (); |
|
|
|
EnumMemberDeclaration newField = new EnumMemberDeclaration (); |
|
|
|
AddAttributeSection (newField, em); |
|
|
|
AddAttributeSection (newField, em); |
|
|
|
newField.AddChild (new Identifier (em.Name, Convert (em.Location)), AstNode.Roles.Identifier); |
|
|
|
newField.AddChild (Identifier.Create (em.Name, Convert (em.Location)), AstNode.Roles.Identifier); |
|
|
|
|
|
|
|
|
|
|
|
if (em.Initializer != null) { |
|
|
|
if (em.Initializer != null) { |
|
|
|
newField.AddChild ((Expression)em.Initializer.Accept (this), EnumMemberDeclaration.InitializerRole); |
|
|
|
newField.AddChild ((Expression)em.Initializer.Accept (this), EnumMemberDeclaration.InitializerRole); |
|
|
|
@ -527,7 +527,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
newField.AddChild (ConvertToType (f.TypeName), FixedFieldDeclaration.Roles.Type); |
|
|
|
newField.AddChild (ConvertToType (f.TypeName), FixedFieldDeclaration.Roles.Type); |
|
|
|
|
|
|
|
|
|
|
|
var variable = new FixedVariableInitializer (); |
|
|
|
var variable = new FixedVariableInitializer (); |
|
|
|
variable.AddChild (new Identifier (f.MemberName.Name, Convert (f.MemberName.Location)), FixedFieldDeclaration.Roles.Identifier); |
|
|
|
variable.AddChild (Identifier.Create (f.MemberName.Name, Convert (f.MemberName.Location)), FixedFieldDeclaration.Roles.Identifier); |
|
|
|
if (!f.Initializer.IsNull) { |
|
|
|
if (!f.Initializer.IsNull) { |
|
|
|
var bracketLocations = LocationsBag.GetLocations (f.Initializer); |
|
|
|
var bracketLocations = LocationsBag.GetLocations (f.Initializer); |
|
|
|
if (bracketLocations != null && bracketLocations.Count > 1) |
|
|
|
if (bracketLocations != null && bracketLocations.Count > 1) |
|
|
|
@ -546,7 +546,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
newField.AddChild (new CSharpTokenNode (Convert (declLoc [0]), 1), FieldDeclaration.Roles.Comma); |
|
|
|
newField.AddChild (new CSharpTokenNode (Convert (declLoc [0]), 1), FieldDeclaration.Roles.Comma); |
|
|
|
|
|
|
|
|
|
|
|
variable = new FixedVariableInitializer (); |
|
|
|
variable = new FixedVariableInitializer (); |
|
|
|
variable.AddChild (new Identifier (decl.Name.Value, Convert (decl.Name.Location)), FieldDeclaration.Roles.Identifier); |
|
|
|
variable.AddChild (Identifier.Create (decl.Name.Value, Convert (decl.Name.Location)), FieldDeclaration.Roles.Identifier); |
|
|
|
if (!decl.Initializer.IsNull) { |
|
|
|
if (!decl.Initializer.IsNull) { |
|
|
|
var bracketLocations = LocationsBag.GetLocations (f.Initializer); |
|
|
|
var bracketLocations = LocationsBag.GetLocations (f.Initializer); |
|
|
|
if (bracketLocations != null && bracketLocations.Count > 1) |
|
|
|
if (bracketLocations != null && bracketLocations.Count > 1) |
|
|
|
@ -574,7 +574,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
newField.AddChild (ConvertToType (f.TypeName), FieldDeclaration.Roles.Type); |
|
|
|
newField.AddChild (ConvertToType (f.TypeName), FieldDeclaration.Roles.Type); |
|
|
|
|
|
|
|
|
|
|
|
VariableInitializer variable = new VariableInitializer (); |
|
|
|
VariableInitializer variable = new VariableInitializer (); |
|
|
|
variable.AddChild (new Identifier (f.MemberName.Name, Convert (f.MemberName.Location)), FieldDeclaration.Roles.Identifier); |
|
|
|
variable.AddChild (Identifier.Create (f.MemberName.Name, Convert (f.MemberName.Location)), FieldDeclaration.Roles.Identifier); |
|
|
|
|
|
|
|
|
|
|
|
if (f.Initializer != null) { |
|
|
|
if (f.Initializer != null) { |
|
|
|
if (location != null) |
|
|
|
if (location != null) |
|
|
|
@ -589,7 +589,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
newField.AddChild (new CSharpTokenNode (Convert (declLoc[0]), 1), FieldDeclaration.Roles.Comma); |
|
|
|
newField.AddChild (new CSharpTokenNode (Convert (declLoc[0]), 1), FieldDeclaration.Roles.Comma); |
|
|
|
|
|
|
|
|
|
|
|
variable = new VariableInitializer (); |
|
|
|
variable = new VariableInitializer (); |
|
|
|
variable.AddChild (new Identifier (decl.Name.Value, Convert (decl.Name.Location)), VariableInitializer.Roles.Identifier); |
|
|
|
variable.AddChild (Identifier.Create (decl.Name.Value, Convert (decl.Name.Location)), VariableInitializer.Roles.Identifier); |
|
|
|
if (decl.Initializer != null) { |
|
|
|
if (decl.Initializer != null) { |
|
|
|
variable.AddChild (new CSharpTokenNode (Convert (decl.Initializer.Location), 1), FieldDeclaration.Roles.Assign); |
|
|
|
variable.AddChild (new CSharpTokenNode (Convert (decl.Initializer.Location), 1), FieldDeclaration.Roles.Assign); |
|
|
|
variable.AddChild ((Expression)decl.Initializer.Accept (this), VariableInitializer.Roles.Expression); |
|
|
|
variable.AddChild ((Expression)decl.Initializer.Accept (this), VariableInitializer.Roles.Expression); |
|
|
|
@ -615,7 +615,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
newField.AddChild (ConvertToType (f.TypeName), FieldDeclaration.Roles.Type); |
|
|
|
newField.AddChild (ConvertToType (f.TypeName), FieldDeclaration.Roles.Type); |
|
|
|
|
|
|
|
|
|
|
|
VariableInitializer variable = new VariableInitializer (); |
|
|
|
VariableInitializer variable = new VariableInitializer (); |
|
|
|
variable.AddChild (new Identifier (f.MemberName.Name, Convert (f.MemberName.Location)), VariableInitializer.Roles.Identifier); |
|
|
|
variable.AddChild (Identifier.Create (f.MemberName.Name, Convert (f.MemberName.Location)), VariableInitializer.Roles.Identifier); |
|
|
|
|
|
|
|
|
|
|
|
if (f.Initializer != null) { |
|
|
|
if (f.Initializer != null) { |
|
|
|
variable.AddChild (new CSharpTokenNode (Convert (f.Initializer.Location), 1), VariableInitializer.Roles.Assign); |
|
|
|
variable.AddChild (new CSharpTokenNode (Convert (f.Initializer.Location), 1), VariableInitializer.Roles.Assign); |
|
|
|
@ -629,7 +629,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
newField.AddChild (new CSharpTokenNode (Convert (declLoc[0]), 1), FieldDeclaration.Roles.Comma); |
|
|
|
newField.AddChild (new CSharpTokenNode (Convert (declLoc[0]), 1), FieldDeclaration.Roles.Comma); |
|
|
|
|
|
|
|
|
|
|
|
variable = new VariableInitializer (); |
|
|
|
variable = new VariableInitializer (); |
|
|
|
variable.AddChild (new Identifier (decl.Name.Value, Convert (decl.Name.Location)), FieldDeclaration.Roles.Identifier); |
|
|
|
variable.AddChild (Identifier.Create (decl.Name.Value, Convert (decl.Name.Location)), FieldDeclaration.Roles.Identifier); |
|
|
|
if (decl.Initializer != null) { |
|
|
|
if (decl.Initializer != null) { |
|
|
|
variable.AddChild (new CSharpTokenNode (Convert (decl.Initializer.Location), 1), FieldDeclaration.Roles.Assign); |
|
|
|
variable.AddChild (new CSharpTokenNode (Convert (decl.Initializer.Location), 1), FieldDeclaration.Roles.Assign); |
|
|
|
variable.AddChild ((Expression)decl.Initializer.Accept (this), VariableInitializer.Roles.Expression); |
|
|
|
variable.AddChild ((Expression)decl.Initializer.Accept (this), VariableInitializer.Roles.Expression); |
|
|
|
@ -764,7 +764,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
if (m.MethodName.Left != null) |
|
|
|
if (m.MethodName.Left != null) |
|
|
|
newMethod.AddChild (ConvertToType (m.MethodName.Left), MethodDeclaration.PrivateImplementationTypeRole); |
|
|
|
newMethod.AddChild (ConvertToType (m.MethodName.Left), MethodDeclaration.PrivateImplementationTypeRole); |
|
|
|
|
|
|
|
|
|
|
|
newMethod.AddChild (new Identifier (m.MethodName.Name, Convert (m.Location)), AstNode.Roles.Identifier); |
|
|
|
newMethod.AddChild (Identifier.Create (m.MethodName.Name, Convert (m.Location)), AstNode.Roles.Identifier); |
|
|
|
|
|
|
|
|
|
|
|
if (m.MemberName.TypeArguments != null) { |
|
|
|
if (m.MemberName.TypeArguments != null) { |
|
|
|
var typeArgLocation = LocationsBag.GetLocations (m.MemberName); |
|
|
|
var typeArgLocation = LocationsBag.GetLocations (m.MemberName); |
|
|
|
@ -854,7 +854,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
if (p.MemberName.Left != null) |
|
|
|
if (p.MemberName.Left != null) |
|
|
|
newProperty.AddChild (ConvertToType (p.MemberName.Left), PropertyDeclaration.PrivateImplementationTypeRole); |
|
|
|
newProperty.AddChild (ConvertToType (p.MemberName.Left), PropertyDeclaration.PrivateImplementationTypeRole); |
|
|
|
|
|
|
|
|
|
|
|
newProperty.AddChild (new Identifier (p.MemberName.Name, Convert (p.Location)), PropertyDeclaration.Roles.Identifier); |
|
|
|
newProperty.AddChild (Identifier.Create (p.MemberName.Name, Convert (p.Location)), PropertyDeclaration.Roles.Identifier); |
|
|
|
|
|
|
|
|
|
|
|
if (location != null) |
|
|
|
if (location != null) |
|
|
|
newProperty.AddChild (new CSharpTokenNode (Convert (location[0]), 1), MethodDeclaration.Roles.LBrace); |
|
|
|
newProperty.AddChild (new CSharpTokenNode (Convert (location[0]), 1), MethodDeclaration.Roles.LBrace); |
|
|
|
@ -902,7 +902,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
AddAttributeSection (newConstructor, c); |
|
|
|
AddAttributeSection (newConstructor, c); |
|
|
|
var location = LocationsBag.GetMemberLocation (c); |
|
|
|
var location = LocationsBag.GetMemberLocation (c); |
|
|
|
AddModifiers (newConstructor, location); |
|
|
|
AddModifiers (newConstructor, location); |
|
|
|
newConstructor.AddChild (new Identifier (c.MemberName.Name, Convert (c.MemberName.Location)), AstNode.Roles.Identifier); |
|
|
|
newConstructor.AddChild (Identifier.Create (c.MemberName.Name, Convert (c.MemberName.Location)), AstNode.Roles.Identifier); |
|
|
|
if (location != null) |
|
|
|
if (location != null) |
|
|
|
newConstructor.AddChild (new CSharpTokenNode (Convert (location[0]), 1), MethodDeclaration.Roles.LPar); |
|
|
|
newConstructor.AddChild (new CSharpTokenNode (Convert (location[0]), 1), MethodDeclaration.Roles.LPar); |
|
|
|
|
|
|
|
|
|
|
|
@ -939,7 +939,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
AddModifiers (newDestructor, location); |
|
|
|
AddModifiers (newDestructor, location); |
|
|
|
if (location != null) |
|
|
|
if (location != null) |
|
|
|
newDestructor.AddChild (new CSharpTokenNode (Convert (location[0]), 1), DestructorDeclaration.TildeRole); |
|
|
|
newDestructor.AddChild (new CSharpTokenNode (Convert (location[0]), 1), DestructorDeclaration.TildeRole); |
|
|
|
newDestructor.AddChild (new Identifier (d.MemberName.Name, Convert (d.MemberName.Location)), AstNode.Roles.Identifier); |
|
|
|
newDestructor.AddChild (Identifier.Create (d.MemberName.Name, Convert (d.MemberName.Location)), AstNode.Roles.Identifier); |
|
|
|
|
|
|
|
|
|
|
|
if (location != null) { |
|
|
|
if (location != null) { |
|
|
|
newDestructor.AddChild (new CSharpTokenNode (Convert (location[1]), 1), DestructorDeclaration.Roles.LPar); |
|
|
|
newDestructor.AddChild (new CSharpTokenNode (Convert (location[1]), 1), DestructorDeclaration.Roles.LPar); |
|
|
|
@ -964,7 +964,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
newEvent.AddChild (ConvertToType (e.TypeName), AstNode.Roles.Type); |
|
|
|
newEvent.AddChild (ConvertToType (e.TypeName), AstNode.Roles.Type); |
|
|
|
|
|
|
|
|
|
|
|
VariableInitializer variable = new VariableInitializer (); |
|
|
|
VariableInitializer variable = new VariableInitializer (); |
|
|
|
variable.AddChild (new Identifier (e.MemberName.Name, Convert (e.MemberName.Location)), FieldDeclaration.Roles.Identifier); |
|
|
|
variable.AddChild (Identifier.Create (e.MemberName.Name, Convert (e.MemberName.Location)), FieldDeclaration.Roles.Identifier); |
|
|
|
|
|
|
|
|
|
|
|
if (e.Initializer != null) { |
|
|
|
if (e.Initializer != null) { |
|
|
|
if (location != null) |
|
|
|
if (location != null) |
|
|
|
@ -979,7 +979,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
newEvent.AddChild (new CSharpTokenNode (Convert (declLoc[0]), 1), FieldDeclaration.Roles.Comma); |
|
|
|
newEvent.AddChild (new CSharpTokenNode (Convert (declLoc[0]), 1), FieldDeclaration.Roles.Comma); |
|
|
|
|
|
|
|
|
|
|
|
variable = new VariableInitializer (); |
|
|
|
variable = new VariableInitializer (); |
|
|
|
variable.AddChild (new Identifier (decl.Name.Value, Convert (decl.Name.Location)), VariableInitializer.Roles.Identifier); |
|
|
|
variable.AddChild (Identifier.Create (decl.Name.Value, Convert (decl.Name.Location)), VariableInitializer.Roles.Identifier); |
|
|
|
|
|
|
|
|
|
|
|
if (decl.Initializer != null) { |
|
|
|
if (decl.Initializer != null) { |
|
|
|
variable.AddChild (new CSharpTokenNode (Convert (decl.Initializer.Location), 1), FieldDeclaration.Roles.Assign); |
|
|
|
variable.AddChild (new CSharpTokenNode (Convert (decl.Initializer.Location), 1), FieldDeclaration.Roles.Assign); |
|
|
|
@ -1008,7 +1008,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
if (ep.MemberName.Left != null) |
|
|
|
if (ep.MemberName.Left != null) |
|
|
|
newEvent.AddChild (ConvertToType (ep.MemberName.Left), CustomEventDeclaration.PrivateImplementationTypeRole); |
|
|
|
newEvent.AddChild (ConvertToType (ep.MemberName.Left), CustomEventDeclaration.PrivateImplementationTypeRole); |
|
|
|
|
|
|
|
|
|
|
|
newEvent.AddChild (new Identifier (ep.MemberName.Name, Convert (ep.Location)), CustomEventDeclaration.Roles.Identifier); |
|
|
|
newEvent.AddChild (Identifier.Create (ep.MemberName.Name, Convert (ep.Location)), CustomEventDeclaration.Roles.Identifier); |
|
|
|
|
|
|
|
|
|
|
|
if (location != null && location.Count >= 2) |
|
|
|
if (location != null && location.Count >= 2) |
|
|
|
newEvent.AddChild (new CSharpTokenNode (Convert (location[1]), 1), CustomEventDeclaration.Roles.LBrace); |
|
|
|
newEvent.AddChild (new CSharpTokenNode (Convert (location[1]), 1), CustomEventDeclaration.Roles.LBrace); |
|
|
|
@ -1057,7 +1057,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
|
|
|
|
|
|
|
|
var varInit = new VariableInitializer (); |
|
|
|
var varInit = new VariableInitializer (); |
|
|
|
var location = LocationsBag.GetLocations (blockVariableDeclaration); |
|
|
|
var location = LocationsBag.GetLocations (blockVariableDeclaration); |
|
|
|
varInit.AddChild (new Identifier (blockVariableDeclaration.Variable.Name, Convert (blockVariableDeclaration.Variable.Location)), VariableInitializer.Roles.Identifier); |
|
|
|
varInit.AddChild (Identifier.Create (blockVariableDeclaration.Variable.Name, Convert (blockVariableDeclaration.Variable.Location)), VariableInitializer.Roles.Identifier); |
|
|
|
if (blockVariableDeclaration.Initializer != null) { |
|
|
|
if (blockVariableDeclaration.Initializer != null) { |
|
|
|
if (location != null) |
|
|
|
if (location != null) |
|
|
|
varInit.AddChild (new CSharpTokenNode (Convert (location[0]), 1), VariableInitializer.Roles.Assign); |
|
|
|
varInit.AddChild (new CSharpTokenNode (Convert (location[0]), 1), VariableInitializer.Roles.Assign); |
|
|
|
@ -1072,7 +1072,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
var init = new VariableInitializer (); |
|
|
|
var init = new VariableInitializer (); |
|
|
|
if (loc != null && loc.Count > 0) |
|
|
|
if (loc != null && loc.Count > 0) |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (loc [0]), 1), VariableInitializer.Roles.Comma); |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (loc [0]), 1), VariableInitializer.Roles.Comma); |
|
|
|
init.AddChild (new Identifier (decl.Variable.Name, Convert (decl.Variable.Location)), VariableInitializer.Roles.Identifier); |
|
|
|
init.AddChild (Identifier.Create (decl.Variable.Name, Convert (decl.Variable.Location)), VariableInitializer.Roles.Identifier); |
|
|
|
if (decl.Initializer != null) { |
|
|
|
if (decl.Initializer != null) { |
|
|
|
if (loc != null && loc.Count > 1) |
|
|
|
if (loc != null && loc.Count > 1) |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (loc [1]), 1), VariableInitializer.Roles.Assign); |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (loc [1]), 1), VariableInitializer.Roles.Assign); |
|
|
|
@ -1098,7 +1098,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
result.AddChild (ConvertToType (blockVariableDeclaration.TypeExpression), VariableDeclarationStatement.Roles.Type); |
|
|
|
result.AddChild (ConvertToType (blockVariableDeclaration.TypeExpression), VariableDeclarationStatement.Roles.Type); |
|
|
|
|
|
|
|
|
|
|
|
var varInit = new VariableInitializer (); |
|
|
|
var varInit = new VariableInitializer (); |
|
|
|
varInit.AddChild (new Identifier (blockVariableDeclaration.Variable.Name, Convert (blockVariableDeclaration.Variable.Location)), VariableInitializer.Roles.Identifier); |
|
|
|
varInit.AddChild (Identifier.Create (blockVariableDeclaration.Variable.Name, Convert (blockVariableDeclaration.Variable.Location)), VariableInitializer.Roles.Identifier); |
|
|
|
if (blockVariableDeclaration.Initializer != null) { |
|
|
|
if (blockVariableDeclaration.Initializer != null) { |
|
|
|
if (location != null) |
|
|
|
if (location != null) |
|
|
|
varInit.AddChild (new CSharpTokenNode (Convert (location[1]), 1), VariableInitializer.Roles.Assign); |
|
|
|
varInit.AddChild (new CSharpTokenNode (Convert (location[1]), 1), VariableInitializer.Roles.Assign); |
|
|
|
@ -1111,7 +1111,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
foreach (var decl in blockVariableDeclaration.Declarators) { |
|
|
|
foreach (var decl in blockVariableDeclaration.Declarators) { |
|
|
|
var loc = LocationsBag.GetLocations (decl); |
|
|
|
var loc = LocationsBag.GetLocations (decl); |
|
|
|
var init = new VariableInitializer (); |
|
|
|
var init = new VariableInitializer (); |
|
|
|
init.AddChild (new Identifier (decl.Variable.Name, Convert (decl.Variable.Location)), VariableInitializer.Roles.Identifier); |
|
|
|
init.AddChild (Identifier.Create (decl.Variable.Name, Convert (decl.Variable.Location)), VariableInitializer.Roles.Identifier); |
|
|
|
if (decl.Initializer != null) { |
|
|
|
if (decl.Initializer != null) { |
|
|
|
if (loc != null) |
|
|
|
if (loc != null) |
|
|
|
init.AddChild (new CSharpTokenNode (Convert (loc[0]), 1), VariableInitializer.Roles.Assign); |
|
|
|
init.AddChild (new CSharpTokenNode (Convert (loc[0]), 1), VariableInitializer.Roles.Assign); |
|
|
|
@ -1280,7 +1280,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
var result = new GotoStatement (); |
|
|
|
var result = new GotoStatement (); |
|
|
|
var location = LocationsBag.GetLocations (gotoStatement); |
|
|
|
var location = LocationsBag.GetLocations (gotoStatement); |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (gotoStatement.loc), "goto".Length), GotoStatement.Roles.Keyword); |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (gotoStatement.loc), "goto".Length), GotoStatement.Roles.Keyword); |
|
|
|
result.AddChild (new Identifier (gotoStatement.Target, Convert (gotoStatement.loc)), GotoStatement.Roles.Identifier); |
|
|
|
result.AddChild (Identifier.Create (gotoStatement.Target, Convert (gotoStatement.loc)), GotoStatement.Roles.Identifier); |
|
|
|
if (location != null) |
|
|
|
if (location != null) |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (location[0]), 1), GotoStatement.Roles.Semicolon); |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (location[0]), 1), GotoStatement.Roles.Semicolon); |
|
|
|
|
|
|
|
|
|
|
|
@ -1290,7 +1290,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
public override object Visit (LabeledStatement labeledStatement) |
|
|
|
public override object Visit (LabeledStatement labeledStatement) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var result = new LabelStatement (); |
|
|
|
var result = new LabelStatement (); |
|
|
|
result.AddChild (new Identifier (labeledStatement.Name, Convert (labeledStatement.loc)), LabelStatement.Roles.Identifier); |
|
|
|
result.AddChild (Identifier.Create (labeledStatement.Name, Convert (labeledStatement.loc)), LabelStatement.Roles.Identifier); |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -1370,7 +1370,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
usingResult.AddChild (new CSharpTokenNode (Convert (blockStatement.StartLocation), 1), UsingStatement.Roles.LPar); |
|
|
|
usingResult.AddChild (new CSharpTokenNode (Convert (blockStatement.StartLocation), 1), UsingStatement.Roles.LPar); |
|
|
|
if (u.Variables != null) { |
|
|
|
if (u.Variables != null) { |
|
|
|
usingResult.AddChild (ConvertToType (u.Variables.TypeExpression), UsingStatement.Roles.Type); |
|
|
|
usingResult.AddChild (ConvertToType (u.Variables.TypeExpression), UsingStatement.Roles.Type); |
|
|
|
usingResult.AddChild (new Identifier (u.Variables.Variable.Name, Convert (u.Variables.Variable.Location)), UsingStatement.Roles.Identifier); |
|
|
|
usingResult.AddChild (Identifier.Create (u.Variables.Variable.Name, Convert (u.Variables.Variable.Location)), UsingStatement.Roles.Identifier); |
|
|
|
var loc = LocationsBag.GetLocations (u.Variables); |
|
|
|
var loc = LocationsBag.GetLocations (u.Variables); |
|
|
|
if (loc != null) |
|
|
|
if (loc != null) |
|
|
|
usingResult.AddChild (new CSharpTokenNode (Convert (loc[1]), 1), ContinueStatement.Roles.Assign); |
|
|
|
usingResult.AddChild (new CSharpTokenNode (Convert (loc[1]), 1), ContinueStatement.Roles.Assign); |
|
|
|
@ -1516,7 +1516,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
result.AddChild (ConvertToType (blockVariableDeclaration.TypeExpression), FixedStatement.Roles.Type); |
|
|
|
result.AddChild (ConvertToType (blockVariableDeclaration.TypeExpression), FixedStatement.Roles.Type); |
|
|
|
var varInit = new VariableInitializer (); |
|
|
|
var varInit = new VariableInitializer (); |
|
|
|
var initLocation = LocationsBag.GetLocations (blockVariableDeclaration); |
|
|
|
var initLocation = LocationsBag.GetLocations (blockVariableDeclaration); |
|
|
|
varInit.AddChild (new Identifier (blockVariableDeclaration.Variable.Name, Convert (blockVariableDeclaration.Variable.Location)), VariableInitializer.Roles.Identifier); |
|
|
|
varInit.AddChild (Identifier.Create (blockVariableDeclaration.Variable.Name, Convert (blockVariableDeclaration.Variable.Location)), VariableInitializer.Roles.Identifier); |
|
|
|
if (blockVariableDeclaration.Initializer != null) { |
|
|
|
if (blockVariableDeclaration.Initializer != null) { |
|
|
|
if (initLocation != null) |
|
|
|
if (initLocation != null) |
|
|
|
varInit.AddChild (new CSharpTokenNode (Convert (location[0]), 1), VariableInitializer.Roles.Assign); |
|
|
|
varInit.AddChild (new CSharpTokenNode (Convert (location[0]), 1), VariableInitializer.Roles.Assign); |
|
|
|
@ -1531,7 +1531,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
var init = new VariableInitializer (); |
|
|
|
var init = new VariableInitializer (); |
|
|
|
if (loc != null && loc.Count > 0) |
|
|
|
if (loc != null && loc.Count > 0) |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (loc [0]), 1), VariableInitializer.Roles.Comma); |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (loc [0]), 1), VariableInitializer.Roles.Comma); |
|
|
|
init.AddChild (new Identifier (decl.Variable.Name, Convert (decl.Variable.Location)), VariableInitializer.Roles.Identifier); |
|
|
|
init.AddChild (Identifier.Create (decl.Variable.Name, Convert (decl.Variable.Location)), VariableInitializer.Roles.Identifier); |
|
|
|
if (decl.Initializer != null) { |
|
|
|
if (decl.Initializer != null) { |
|
|
|
if (loc != null && loc.Count > 1) |
|
|
|
if (loc != null && loc.Count > 1) |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (loc [1]), 1), VariableInitializer.Roles.Assign); |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (loc [1]), 1), VariableInitializer.Roles.Assign); |
|
|
|
@ -1580,7 +1580,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
|
|
|
|
|
|
|
|
result.AddChild (ConvertToType (ctch.TypeExpression), CatchClause.Roles.Type); |
|
|
|
result.AddChild (ConvertToType (ctch.TypeExpression), CatchClause.Roles.Type); |
|
|
|
if (ctch.Variable != null && !string.IsNullOrEmpty (ctch.Variable.Name)) |
|
|
|
if (ctch.Variable != null && !string.IsNullOrEmpty (ctch.Variable.Name)) |
|
|
|
result.AddChild (new Identifier (ctch.Variable.Name, Convert (ctch.Variable.Location)), CatchClause.Roles.Identifier); |
|
|
|
result.AddChild (Identifier.Create (ctch.Variable.Name, Convert (ctch.Variable.Location)), CatchClause.Roles.Identifier); |
|
|
|
|
|
|
|
|
|
|
|
if (location != null) |
|
|
|
if (location != null) |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (location[1]), 1), CatchClause.Roles.RPar); |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (location[1]), 1), CatchClause.Roles.RPar); |
|
|
|
@ -1639,7 +1639,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
if (foreachStatement.TypeExpr != null) |
|
|
|
if (foreachStatement.TypeExpr != null) |
|
|
|
result.AddChild (ConvertToType (foreachStatement.TypeExpr), ForeachStatement.Roles.Type); |
|
|
|
result.AddChild (ConvertToType (foreachStatement.TypeExpr), ForeachStatement.Roles.Type); |
|
|
|
if (foreachStatement.Variable != null) |
|
|
|
if (foreachStatement.Variable != null) |
|
|
|
result.AddChild (new Identifier (foreachStatement.Variable.Name, Convert (foreachStatement.Variable.Location)), ForeachStatement.Roles.Identifier); |
|
|
|
result.AddChild (Identifier.Create (foreachStatement.Variable.Name, Convert (foreachStatement.Variable.Location)), ForeachStatement.Roles.Identifier); |
|
|
|
|
|
|
|
|
|
|
|
if (location != null) |
|
|
|
if (location != null) |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (location [1]), "in".Length), ForeachStatement.Roles.InKeyword); |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (location [1]), "in".Length), ForeachStatement.Roles.InKeyword); |
|
|
|
@ -1704,7 +1704,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
|
|
|
|
|
|
|
|
public override object Visit (LocalVariableReference localVariableReference) |
|
|
|
public override object Visit (LocalVariableReference localVariableReference) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return new Identifier (localVariableReference.Name, Convert (localVariableReference.Location));; |
|
|
|
return Identifier.Create (localVariableReference.Name, Convert (localVariableReference.Location));; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public override object Visit (MemberAccess memberAccess) |
|
|
|
public override object Visit (MemberAccess memberAccess) |
|
|
|
@ -1723,7 +1723,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
result.AddChild (new Identifier (memberAccess.Name, Convert (memberAccess.Location)), MemberReferenceExpression.Roles.Identifier); |
|
|
|
result.AddChild (Identifier.Create (memberAccess.Name, Convert (memberAccess.Location)), MemberReferenceExpression.Roles.Identifier); |
|
|
|
|
|
|
|
|
|
|
|
if (memberAccess.TypeArguments != null) { |
|
|
|
if (memberAccess.TypeArguments != null) { |
|
|
|
var location = LocationsBag.GetLocations (memberAccess); |
|
|
|
var location = LocationsBag.GetLocations (memberAccess); |
|
|
|
@ -1742,7 +1742,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
result.Target = new SimpleType (qualifiedAliasMember.alias, Convert (qualifiedAliasMember.Location)); |
|
|
|
result.Target = new SimpleType (qualifiedAliasMember.alias, Convert (qualifiedAliasMember.Location)); |
|
|
|
result.IsDoubleColon = true; |
|
|
|
result.IsDoubleColon = true; |
|
|
|
var location = LocationsBag.GetLocations (qualifiedAliasMember); |
|
|
|
var location = LocationsBag.GetLocations (qualifiedAliasMember); |
|
|
|
result.AddChild (new Identifier (qualifiedAliasMember.Name, location != null ? Convert (location[0]) : AstLocation.Empty), MemberReferenceExpression.Roles.Identifier); |
|
|
|
result.AddChild (Identifier.Create (qualifiedAliasMember.Name, location != null ? Convert (location[0]) : AstLocation.Empty), MemberReferenceExpression.Roles.Identifier); |
|
|
|
return new TypeReferenceExpression () { Type = result }; |
|
|
|
return new TypeReferenceExpression () { Type = result }; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -1763,7 +1763,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
public override object Visit (SimpleName simpleName) |
|
|
|
public override object Visit (SimpleName simpleName) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var result = new IdentifierExpression (); |
|
|
|
var result = new IdentifierExpression (); |
|
|
|
result.AddChild (new Identifier (simpleName.Name, Convert (simpleName.Location)), IdentifierExpression.Roles.Identifier); |
|
|
|
result.AddChild (Identifier.Create (simpleName.Name, Convert (simpleName.Location)), IdentifierExpression.Roles.Identifier); |
|
|
|
if (simpleName.TypeArguments != null) { |
|
|
|
if (simpleName.TypeArguments != null) { |
|
|
|
var location = LocationsBag.GetLocations (simpleName); |
|
|
|
var location = LocationsBag.GetLocations (simpleName); |
|
|
|
if (location != null) |
|
|
|
if (location != null) |
|
|
|
@ -2073,7 +2073,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
if (p.TypeExpression != null) // lambdas may have no types (a, b) => ...
|
|
|
|
if (p.TypeExpression != null) // lambdas may have no types (a, b) => ...
|
|
|
|
parameterDeclarationExpression.AddChild (ConvertToType (p.TypeExpression), ParameterDeclaration.Roles.Type); |
|
|
|
parameterDeclarationExpression.AddChild (ConvertToType (p.TypeExpression), ParameterDeclaration.Roles.Type); |
|
|
|
if (p.Name != null) |
|
|
|
if (p.Name != null) |
|
|
|
parameterDeclarationExpression.AddChild (new Identifier (p.Name, Convert (p.Location)), ParameterDeclaration.Roles.Identifier); |
|
|
|
parameterDeclarationExpression.AddChild (Identifier.Create (p.Name, Convert (p.Location)), ParameterDeclaration.Roles.Identifier); |
|
|
|
if (p.HasDefaultValue) { |
|
|
|
if (p.HasDefaultValue) { |
|
|
|
if (location != null) |
|
|
|
if (location != null) |
|
|
|
parameterDeclarationExpression.AddChild (new CSharpTokenNode (Convert (location [1]), 1), ParameterDeclaration.Roles.Assign); |
|
|
|
parameterDeclarationExpression.AddChild (new CSharpTokenNode (Convert (location [1]), 1), ParameterDeclaration.Roles.Assign); |
|
|
|
@ -2097,7 +2097,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
// TODO: attributes
|
|
|
|
// TODO: attributes
|
|
|
|
// if (arg.Variance != Variance.None)
|
|
|
|
// if (arg.Variance != Variance.None)
|
|
|
|
// throw new NotImplementedException(); // TODO: variance
|
|
|
|
// throw new NotImplementedException(); // TODO: variance
|
|
|
|
tp.AddChild (new Identifier (arg.Name, Convert (arg.Location)), InvocationExpression.Roles.Identifier); |
|
|
|
tp.AddChild (Identifier.Create (arg.Name, Convert (arg.Location)), InvocationExpression.Roles.Identifier); |
|
|
|
parent.AddChild (tp, InvocationExpression.Roles.TypeParameter); |
|
|
|
parent.AddChild (tp, InvocationExpression.Roles.TypeParameter); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -2140,7 +2140,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
var constraint = new Constraint (); |
|
|
|
var constraint = new Constraint (); |
|
|
|
if (location != null) |
|
|
|
if (location != null) |
|
|
|
constraint.AddChild (new CSharpTokenNode (Convert (location [0]), "where".Length), InvocationExpression.Roles.Keyword); |
|
|
|
constraint.AddChild (new CSharpTokenNode (Convert (location [0]), "where".Length), InvocationExpression.Roles.Keyword); |
|
|
|
constraint.AddChild (new Identifier (c.TypeParameter.Value, Convert (c.TypeParameter.Location)), InvocationExpression.Roles.Identifier); |
|
|
|
constraint.AddChild (Identifier.Create (c.TypeParameter.Value, Convert (c.TypeParameter.Location)), InvocationExpression.Roles.Identifier); |
|
|
|
if (location != null && location.Count > 1) |
|
|
|
if (location != null && location.Count > 1) |
|
|
|
constraint.AddChild (new CSharpTokenNode (Convert (location [1]), 1), Constraint.ColonRole); |
|
|
|
constraint.AddChild (new CSharpTokenNode (Convert (location [1]), 1), Constraint.ColonRole); |
|
|
|
foreach (var expr in c.ConstraintExpressions) |
|
|
|
foreach (var expr in c.ConstraintExpressions) |
|
|
|
@ -2154,7 +2154,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
if (arg is NamedArgument) { |
|
|
|
if (arg is NamedArgument) { |
|
|
|
var na = (NamedArgument)arg; |
|
|
|
var na = (NamedArgument)arg; |
|
|
|
NamedArgumentExpression newArg = new NamedArgumentExpression(); |
|
|
|
NamedArgumentExpression newArg = new NamedArgumentExpression(); |
|
|
|
newArg.AddChild (new Identifier (na.Name, Convert (na.Location)), NamedArgumentExpression.Roles.Identifier); |
|
|
|
newArg.AddChild (Identifier.Create (na.Name, Convert (na.Location)), NamedArgumentExpression.Roles.Identifier); |
|
|
|
|
|
|
|
|
|
|
|
var loc = LocationsBag.GetLocations (na); |
|
|
|
var loc = LocationsBag.GetLocations (na); |
|
|
|
if (loc != null) |
|
|
|
if (loc != null) |
|
|
|
@ -2251,7 +2251,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
result.AddChild ((Expression)par.Expr.Accept (this), AnonymousTypeCreateExpression.Roles.Expression); |
|
|
|
result.AddChild ((Expression)par.Expr.Accept (this), AnonymousTypeCreateExpression.Roles.Expression); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
var namedArgument = new NamedArgumentExpression (); |
|
|
|
var namedArgument = new NamedArgumentExpression (); |
|
|
|
namedArgument.AddChild (new Identifier (par.Name, Convert (par.Location)), AnonymousTypeCreateExpression.Roles.Identifier); |
|
|
|
namedArgument.AddChild (Identifier.Create (par.Name, Convert (par.Location)), AnonymousTypeCreateExpression.Roles.Identifier); |
|
|
|
namedArgument.AddChild (new CSharpTokenNode (Convert (location[0]), 1), AnonymousTypeCreateExpression.Roles.Assign); |
|
|
|
namedArgument.AddChild (new CSharpTokenNode (Convert (location[0]), 1), AnonymousTypeCreateExpression.Roles.Assign); |
|
|
|
namedArgument.AddChild ((Expression)par.Expr.Accept (this), AnonymousTypeCreateExpression.Roles.Expression); |
|
|
|
namedArgument.AddChild ((Expression)par.Expr.Accept (this), AnonymousTypeCreateExpression.Roles.Expression); |
|
|
|
result.AddChild (namedArgument, AnonymousTypeCreateExpression.Roles.Expression); |
|
|
|
result.AddChild (namedArgument, AnonymousTypeCreateExpression.Roles.Expression); |
|
|
|
@ -2659,7 +2659,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
if (queryStart.Expr == null) { |
|
|
|
if (queryStart.Expr == null) { |
|
|
|
var intoClause = new QueryContinuationClause (); |
|
|
|
var intoClause = new QueryContinuationClause (); |
|
|
|
intoClause.AddChild (new CSharpTokenNode (Convert (queryStart.Location), "into".Length), QueryContinuationClause.IntoKeywordRole); |
|
|
|
intoClause.AddChild (new CSharpTokenNode (Convert (queryStart.Location), "into".Length), QueryContinuationClause.IntoKeywordRole); |
|
|
|
intoClause.AddChild (new Identifier (queryStart.IntoVariable.Name, Convert(queryStart.IntoVariable.Location)), QueryContinuationClause.Roles.Identifier); |
|
|
|
intoClause.AddChild (Identifier.Create (queryStart.IntoVariable.Name, Convert(queryStart.IntoVariable.Location)), QueryContinuationClause.Roles.Identifier); |
|
|
|
return intoClause; |
|
|
|
return intoClause; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -2671,7 +2671,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
if (queryStart.IdentifierType != null) |
|
|
|
if (queryStart.IdentifierType != null) |
|
|
|
fromClause.AddChild (ConvertToType (queryStart.IdentifierType), QueryFromClause.Roles.Type); |
|
|
|
fromClause.AddChild (ConvertToType (queryStart.IdentifierType), QueryFromClause.Roles.Type); |
|
|
|
|
|
|
|
|
|
|
|
fromClause.AddChild (new Identifier (queryStart.IntoVariable.Name, Convert(queryStart.IntoVariable.Location)), QueryFromClause.Roles.Identifier); |
|
|
|
fromClause.AddChild (Identifier.Create (queryStart.IntoVariable.Name, Convert(queryStart.IntoVariable.Location)), QueryFromClause.Roles.Identifier); |
|
|
|
|
|
|
|
|
|
|
|
if (location != null) |
|
|
|
if (location != null) |
|
|
|
fromClause.AddChild (new CSharpTokenNode (Convert (location[0]), "in".Length), QueryFromClause.InKeywordRole); |
|
|
|
fromClause.AddChild (new CSharpTokenNode (Convert (location[0]), "in".Length), QueryFromClause.InKeywordRole); |
|
|
|
@ -2689,7 +2689,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
if (queryStart.IdentifierType != null) |
|
|
|
if (queryStart.IdentifierType != null) |
|
|
|
fromClause.AddChild (ConvertToType (queryStart.IdentifierType), QueryFromClause.Roles.Type); |
|
|
|
fromClause.AddChild (ConvertToType (queryStart.IdentifierType), QueryFromClause.Roles.Type); |
|
|
|
|
|
|
|
|
|
|
|
fromClause.AddChild (new Identifier (queryStart.IntoVariable.Name, Convert(queryStart.IntoVariable.Location)), QueryFromClause.Roles.Identifier); |
|
|
|
fromClause.AddChild (Identifier.Create (queryStart.IntoVariable.Name, Convert(queryStart.IntoVariable.Location)), QueryFromClause.Roles.Identifier); |
|
|
|
|
|
|
|
|
|
|
|
if (location != null) |
|
|
|
if (location != null) |
|
|
|
fromClause.AddChild (new CSharpTokenNode (Convert (location[0]), "in".Length), QueryFromClause.InKeywordRole); |
|
|
|
fromClause.AddChild (new CSharpTokenNode (Convert (location[0]), "in".Length), QueryFromClause.InKeywordRole); |
|
|
|
@ -2723,7 +2723,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
var location = LocationsBag.GetLocations (l); |
|
|
|
var location = LocationsBag.GetLocations (l); |
|
|
|
|
|
|
|
|
|
|
|
result.AddChild (new CSharpTokenNode (Convert (l.Location), "let".Length), QueryLetClause.Roles.Keyword); |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (l.Location), "let".Length), QueryLetClause.Roles.Keyword); |
|
|
|
result.AddChild (new Identifier (l.IntoVariable.Name, Convert (l.IntoVariable.Location)), Identifier.Roles.Identifier); |
|
|
|
result.AddChild (Identifier.Create (l.IntoVariable.Name, Convert (l.IntoVariable.Location)), Identifier.Roles.Identifier); |
|
|
|
if (location != null) |
|
|
|
if (location != null) |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (location[0]), 1), QueryLetClause.Roles.Assign); |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (location[0]), 1), QueryLetClause.Roles.Assign); |
|
|
|
result.AddChild ((Expression)l.Expr.Accept (this), QueryLetClause.Roles.Expression); |
|
|
|
result.AddChild ((Expression)l.Expr.Accept (this), QueryLetClause.Roles.Expression); |
|
|
|
@ -2746,7 +2746,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
var location = LocationsBag.GetLocations (join); |
|
|
|
var location = LocationsBag.GetLocations (join); |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (join.Location), "join".Length), QueryJoinClause.JoinKeywordRole); |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (join.Location), "join".Length), QueryJoinClause.JoinKeywordRole); |
|
|
|
|
|
|
|
|
|
|
|
result.AddChild (new Identifier (join.JoinVariable.Name, Convert (join.JoinVariable.Location)), Identifier.Roles.Identifier); |
|
|
|
result.AddChild (Identifier.Create (join.JoinVariable.Name, Convert (join.JoinVariable.Location)), Identifier.Roles.Identifier); |
|
|
|
|
|
|
|
|
|
|
|
if (location != null) |
|
|
|
if (location != null) |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (location[0]), "in".Length), QueryJoinClause.InKeywordRole); |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (location[0]), "in".Length), QueryJoinClause.InKeywordRole); |
|
|
|
@ -2770,7 +2770,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
var location = LocationsBag.GetLocations (join); |
|
|
|
var location = LocationsBag.GetLocations (join); |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (join.Location), "join".Length), QueryJoinClause.JoinKeywordRole); |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (join.Location), "join".Length), QueryJoinClause.JoinKeywordRole); |
|
|
|
|
|
|
|
|
|
|
|
result.AddChild (new Identifier (join.JoinVariable.Name, Convert (join.JoinVariable.Location)), Identifier.Roles.Identifier); |
|
|
|
result.AddChild (Identifier.Create (join.JoinVariable.Name, Convert (join.JoinVariable.Location)), Identifier.Roles.Identifier); |
|
|
|
|
|
|
|
|
|
|
|
if (location != null) |
|
|
|
if (location != null) |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (location[0]), "in".Length), QueryJoinClause.InKeywordRole); |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (location[0]), "in".Length), QueryJoinClause.InKeywordRole); |
|
|
|
@ -2789,7 +2789,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
if (location != null) |
|
|
|
if (location != null) |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (location[3]), "into".Length), QueryJoinClause.IntoKeywordRole); |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (location[3]), "into".Length), QueryJoinClause.IntoKeywordRole); |
|
|
|
|
|
|
|
|
|
|
|
result.AddChild (new Identifier (join.JoinVariable.Name, Convert (join.JoinVariable.Location)), Identifier.Roles.Identifier); |
|
|
|
result.AddChild (Identifier.Create (join.JoinVariable.Name, Convert (join.JoinVariable.Location)), Identifier.Roles.Identifier); |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|