Browse Source

Fix switch expression.

pull/100/head
Daniel Grunwald 15 years ago
parent
commit
98678dcc4e
  1. 1
      ICSharpCode.Decompiler/Ast/Transforms/PatternStatementTransform.cs

1
ICSharpCode.Decompiler/Ast/Transforms/PatternStatementTransform.cs

@ -439,6 +439,7 @@ namespace ICSharpCode.Decompiler.Ast.Transforms
List<Statement> dictCreation = m.Get<BlockStatement>("dictCreation").Single().Statements.ToList(); List<Statement> dictCreation = m.Get<BlockStatement>("dictCreation").Single().Statements.ToList();
List<KeyValuePair<string, int>> dict = BuildDictionary(dictCreation); List<KeyValuePair<string, int>> dict = BuildDictionary(dictCreation);
SwitchStatement sw = m.Get<SwitchStatement>("switch").Single(); SwitchStatement sw = m.Get<SwitchStatement>("switch").Single();
sw.Expression = m.Get<Expression>("switchVar").Single().Detach();
foreach (SwitchSection section in sw.SwitchSections) { foreach (SwitchSection section in sw.SwitchSections) {
List<CaseLabel> labels = section.CaseLabels.ToList(); List<CaseLabel> labels = section.CaseLabels.ToList();
section.CaseLabels.Clear(); section.CaseLabels.Clear();

Loading…
Cancel
Save