|
|
|
@ -358,8 +358,12 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
newType.AddChild (new CSharpTokenNode (Convert (location[1]), 1), AstNode.Roles.LBrace); |
|
|
|
newType.AddChild (new CSharpTokenNode (Convert (location[1]), 1), AstNode.Roles.LBrace); |
|
|
|
typeStack.Push (newType); |
|
|
|
typeStack.Push (newType); |
|
|
|
base.Visit (c); |
|
|
|
base.Visit (c); |
|
|
|
if (location != null && location.Count > 2) |
|
|
|
if (location != null && location.Count > 2) { |
|
|
|
newType.AddChild (new CSharpTokenNode (Convert (location[2]), 1), AstNode.Roles.RBrace); |
|
|
|
newType.AddChild (new CSharpTokenNode (Convert (location[2]), 1), AstNode.Roles.RBrace); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// parser error, set end node to max value.
|
|
|
|
|
|
|
|
newType.AddChild (new ErrorNode (), AstNode.Roles.Error); |
|
|
|
|
|
|
|
} |
|
|
|
typeStack.Pop (); |
|
|
|
typeStack.Pop (); |
|
|
|
AddType (newType); |
|
|
|
AddType (newType); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -394,8 +398,12 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
newType.AddChild (new CSharpTokenNode (Convert (location[1]), 1), AstNode.Roles.LBrace); |
|
|
|
newType.AddChild (new CSharpTokenNode (Convert (location[1]), 1), AstNode.Roles.LBrace); |
|
|
|
typeStack.Push (newType); |
|
|
|
typeStack.Push (newType); |
|
|
|
base.Visit (s); |
|
|
|
base.Visit (s); |
|
|
|
if (location != null && location.Count > 2) |
|
|
|
if (location != null && location.Count > 2) { |
|
|
|
newType.AddChild (new CSharpTokenNode (Convert (location[2]), 1), AstNode.Roles.RBrace); |
|
|
|
newType.AddChild (new CSharpTokenNode (Convert (location[2]), 1), AstNode.Roles.RBrace); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// parser error, set end node to max value.
|
|
|
|
|
|
|
|
newType.AddChild (new ErrorNode (), AstNode.Roles.Error); |
|
|
|
|
|
|
|
} |
|
|
|
typeStack.Pop (); |
|
|
|
typeStack.Pop (); |
|
|
|
AddType (newType); |
|
|
|
AddType (newType); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -428,8 +436,12 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
newType.AddChild (new CSharpTokenNode (Convert (location[1]), 1), AstNode.Roles.LBrace); |
|
|
|
newType.AddChild (new CSharpTokenNode (Convert (location[1]), 1), AstNode.Roles.LBrace); |
|
|
|
typeStack.Push (newType); |
|
|
|
typeStack.Push (newType); |
|
|
|
base.Visit (i); |
|
|
|
base.Visit (i); |
|
|
|
if (location != null && location.Count > 2) |
|
|
|
if (location != null && location.Count > 2) { |
|
|
|
newType.AddChild (new CSharpTokenNode (Convert (location[2]), 1), AstNode.Roles.RBrace); |
|
|
|
newType.AddChild (new CSharpTokenNode (Convert (location[2]), 1), AstNode.Roles.RBrace); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// parser error, set end node to max value.
|
|
|
|
|
|
|
|
newType.AddChild (new ErrorNode (), AstNode.Roles.Error); |
|
|
|
|
|
|
|
} |
|
|
|
typeStack.Pop (); |
|
|
|
typeStack.Pop (); |
|
|
|
AddType (newType); |
|
|
|
AddType (newType); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -501,8 +513,12 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
newType.AddChild (new CSharpTokenNode (Convert (location[1]), 1), AstNode.Roles.LBrace); |
|
|
|
newType.AddChild (new CSharpTokenNode (Convert (location[1]), 1), AstNode.Roles.LBrace); |
|
|
|
typeStack.Push (newType); |
|
|
|
typeStack.Push (newType); |
|
|
|
base.Visit (e); |
|
|
|
base.Visit (e); |
|
|
|
if (location != null && location.Count > 2) |
|
|
|
if (location != null && location.Count > 2) { |
|
|
|
newType.AddChild (new CSharpTokenNode (Convert (location[2]), 1), AstNode.Roles.RBrace); |
|
|
|
newType.AddChild (new CSharpTokenNode (Convert (location[2]), 1), AstNode.Roles.RBrace); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// parser error, set end node to max value.
|
|
|
|
|
|
|
|
newType.AddChild (new ErrorNode (), AstNode.Roles.Error); |
|
|
|
|
|
|
|
} |
|
|
|
typeStack.Pop (); |
|
|
|
typeStack.Pop (); |
|
|
|
AddType (newType); |
|
|
|
AddType (newType); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -756,9 +772,12 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
newIndexer.AddChild (setAccessor, PropertyDeclaration.SetterRole); |
|
|
|
newIndexer.AddChild (setAccessor, PropertyDeclaration.SetterRole); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (location != null) |
|
|
|
if (location != null) { |
|
|
|
newIndexer.AddChild (new CSharpTokenNode (Convert (location[3]), 1), IndexerDeclaration.Roles.RBrace); |
|
|
|
newIndexer.AddChild (new CSharpTokenNode (Convert (location[3]), 1), IndexerDeclaration.Roles.RBrace); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// parser error, set end node to max value.
|
|
|
|
|
|
|
|
newIndexer.AddChild (new ErrorNode (), AstNode.Roles.Error); |
|
|
|
|
|
|
|
} |
|
|
|
typeStack.Peek ().AddChild (newIndexer, TypeDeclaration.MemberRole); |
|
|
|
typeStack.Peek ().AddChild (newIndexer, TypeDeclaration.MemberRole); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -798,6 +817,9 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
// } else {
|
|
|
|
// } else {
|
|
|
|
newMethod.AddChild (bodyBlock, MethodDeclaration.Roles.Body); |
|
|
|
newMethod.AddChild (bodyBlock, MethodDeclaration.Roles.Body); |
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
} else if (location != null && location.Count < 3) { |
|
|
|
|
|
|
|
// parser error, set end node to max value.
|
|
|
|
|
|
|
|
newMethod.AddChild (new ErrorNode (), AstNode.Roles.Error); |
|
|
|
} |
|
|
|
} |
|
|
|
typeStack.Peek ().AddChild (newMethod, TypeDeclaration.MemberRole); |
|
|
|
typeStack.Peek ().AddChild (newMethod, TypeDeclaration.MemberRole); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -899,8 +921,12 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
} |
|
|
|
} |
|
|
|
newProperty.AddChild (setAccessor, PropertyDeclaration.SetterRole); |
|
|
|
newProperty.AddChild (setAccessor, PropertyDeclaration.SetterRole); |
|
|
|
} |
|
|
|
} |
|
|
|
if (location != null && location.Count > 1) |
|
|
|
if (location != null && location.Count > 1) { |
|
|
|
newProperty.AddChild (new CSharpTokenNode (Convert (location[1]), 1), MethodDeclaration.Roles.RBrace); |
|
|
|
newProperty.AddChild (new CSharpTokenNode (Convert (location[1]), 1), MethodDeclaration.Roles.RBrace); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// parser error, set end node to max value.
|
|
|
|
|
|
|
|
newProperty.AddChild (new ErrorNode (), AstNode.Roles.Error); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
typeStack.Peek ().AddChild (newProperty, TypeDeclaration.MemberRole); |
|
|
|
typeStack.Peek ().AddChild (newProperty, TypeDeclaration.MemberRole); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1044,8 +1070,12 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
removeAccessor.AddChild ((BlockStatement)ep.Remove.Block.Accept (this), CustomEventDeclaration.Roles.Body); |
|
|
|
removeAccessor.AddChild ((BlockStatement)ep.Remove.Block.Accept (this), CustomEventDeclaration.Roles.Body); |
|
|
|
newEvent.AddChild (removeAccessor, CustomEventDeclaration.RemoveAccessorRole); |
|
|
|
newEvent.AddChild (removeAccessor, CustomEventDeclaration.RemoveAccessorRole); |
|
|
|
} |
|
|
|
} |
|
|
|
if (location != null && location.Count >= 3) |
|
|
|
if (location != null && location.Count >= 3) { |
|
|
|
newEvent.AddChild (new CSharpTokenNode (Convert (location[2]), 1), CustomEventDeclaration.Roles.RBrace); |
|
|
|
newEvent.AddChild (new CSharpTokenNode (Convert (location[2]), 1), CustomEventDeclaration.Roles.RBrace); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// parser error, set end node to max value.
|
|
|
|
|
|
|
|
newEvent.AddChild (new ErrorNode (), AstNode.Roles.Error); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
typeStack.Peek ().AddChild (newEvent, TypeDeclaration.MemberRole); |
|
|
|
typeStack.Peek ().AddChild (newEvent, TypeDeclaration.MemberRole); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1134,8 +1164,12 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
result.AddChild (init, VariableDeclarationStatement.Roles.Variable); |
|
|
|
result.AddChild (init, VariableDeclarationStatement.Roles.Variable); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (location != null) |
|
|
|
if (location != null) { |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (location[location.Count - 1]), 1), VariableDeclarationStatement.Roles.Semicolon); |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (location[location.Count - 1]), 1), VariableDeclarationStatement.Roles.Semicolon); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// parser error, set end node to max value.
|
|
|
|
|
|
|
|
result.AddChild (new ErrorNode (), AstNode.Roles.Error); |
|
|
|
|
|
|
|
} |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -1474,8 +1508,13 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
result.AddChild (newSection, SwitchStatement.SwitchSectionRole); |
|
|
|
result.AddChild (newSection, SwitchStatement.SwitchSectionRole); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (location != null) |
|
|
|
if (location != null) { |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (location[3]), 1), SwitchStatement.Roles.RBrace); |
|
|
|
result.AddChild (new CSharpTokenNode (Convert (location[3]), 1), SwitchStatement.Roles.RBrace); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// parser error, set end node to max value.
|
|
|
|
|
|
|
|
result.AddChild (new ErrorNode (), AstNode.Roles.Error); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -1604,7 +1643,7 @@ namespace ICSharpCode.NRefactory.CSharp |
|
|
|
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); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (ctch.Block != null) |
|
|
|
if (ctch.Block != null) |
|
|
|
result.AddChild ((BlockStatement)ctch.Block.Accept (this), CatchClause.Roles.Body); |
|
|
|
result.AddChild ((BlockStatement)ctch.Block.Accept (this), CatchClause.Roles.Body); |
|
|
|
|
|
|
|
|
|
|
|
|