diff --git a/libs/UIX.DecompXml/ControlFlowAnalyzer.cs b/libs/UIX.DecompXml/ControlFlowAnalyzer.cs index bad44db..1aebce5 100644 --- a/libs/UIX.DecompXml/ControlFlowAnalyzer.cs +++ b/libs/UIX.DecompXml/ControlFlowAnalyzer.cs @@ -56,25 +56,7 @@ public class ControlFlowAnalyzer } } - public void PushBlock(CodeBlock block) - { - BlockStack.Push(block); - return; - - while (BlockStack.Count > 1) - { - var currentBlock = BlockStack.Pop(); - var parentBlock = BlockStack.Peek(); - - if (currentBlock.EndOffset <= parentBlock.EndOffset) - { - BlockStack.Push(currentBlock); - break; - } - - currentBlock.FinalizeBlock(parentBlock); - } - } + public void PushBlock(CodeBlock block) => BlockStack.Push(block); public bool TryPeekBlockInfo(out T info) where T : ICodeBlockInfo => TryPeekBlock(out _, out info); diff --git a/libs/UIX.Test/DecompileControlFlow.cs b/libs/UIX.Test/DecompileControlFlow.cs index cf0880a..c7b03a9 100644 --- a/libs/UIX.Test/DecompileControlFlow.cs +++ b/libs/UIX.Test/DecompileControlFlow.cs @@ -1,5 +1,4 @@ -using Microsoft.Iris; -using Microsoft.Iris.DecompXml; +using Microsoft.Iris.DecompXml; using Microsoft.Iris.Markup; using UIX.Test.Fixtures; using Xunit.Abstractions; @@ -40,18 +39,6 @@ public class DecompileControlFlow using TempFile uixFile = new($"{fileNameWithoutExtension}.uix", ".uix"); await uixFile.InitAsync(); - var uibPathEx = Path.ChangeExtension(uixFile.Path, ".uib"); - - // Compile the UIX source - CompilerInput uixCompilerInput = new() - { - SourceFileName = uixFile.Path, - OutputFileName = uibPathEx - }; - var uixSuccess = MarkupCompiler.Compile([uixCompilerInput], default); - Assert.True(uixSuccess); - - // Decompile the compiled UIX var sourceLoadResult = MarkupSystem.ResolveLoadResult($"file://{uixFile.Path}", MarkupSystem.RootIslandId); var decompiler = Decompiler.Load(sourceLoadResult); var uixDocAc = decompiler.Decompile();