Browse Source

fixed switch section.

newNRvisualizers
Mike Krüger 15 years ago
parent
commit
31113d214e
  1. 7
      ICSharpCode.NRefactory/CSharp/Parser/CSharpParser.cs

7
ICSharpCode.NRefactory/CSharp/Parser/CSharpParser.cs

@ -1240,8 +1240,11 @@ namespace ICSharpCode.NRefactory.CSharp
var bodyBlock = new BlockStatement (); var bodyBlock = new BlockStatement ();
int curLocal = 0; int curLocal = 0;
AddBlockChildren (bodyBlock, blockStatement, ref curLocal); AddBlockChildren (bodyBlock, blockStatement, ref curLocal);
foreach (var statement in bodyBlock.Statements) {
newSection.AddChild (bodyBlock, SwitchSection.Roles.Body); statement.Remove ();
newSection.AddChild (statement, MonoDevelop.CSharp.Ast.SwitchSection.Roles.EmbeddedStatement);
}
result.AddChild (newSection, SwitchStatement.SwitchSectionRole); result.AddChild (newSection, SwitchStatement.SwitchSectionRole);
} }

Loading…
Cancel
Save