From 31113d214e712c27e9b8ab81d781038b74d957be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Kr=C3=BCger?= Date: Mon, 14 Feb 2011 13:38:14 +0100 Subject: [PATCH] fixed switch section. --- ICSharpCode.NRefactory/CSharp/Parser/CSharpParser.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ICSharpCode.NRefactory/CSharp/Parser/CSharpParser.cs b/ICSharpCode.NRefactory/CSharp/Parser/CSharpParser.cs index 44b709c7a8..6ee0128c64 100644 --- a/ICSharpCode.NRefactory/CSharp/Parser/CSharpParser.cs +++ b/ICSharpCode.NRefactory/CSharp/Parser/CSharpParser.cs @@ -1240,8 +1240,11 @@ namespace ICSharpCode.NRefactory.CSharp var bodyBlock = new BlockStatement (); int curLocal = 0; AddBlockChildren (bodyBlock, blockStatement, ref curLocal); - - newSection.AddChild (bodyBlock, SwitchSection.Roles.Body); + foreach (var statement in bodyBlock.Statements) { + statement.Remove (); + newSection.AddChild (statement, MonoDevelop.CSharp.Ast.SwitchSection.Roles.EmbeddedStatement); + + } result.AddChild (newSection, SwitchStatement.SwitchSectionRole); }