// Merge two blocks into one public void merge(Block other) { if (!canMerge(other)) { throw new ApplicationException("Can't merge the two blocks!"); } append(other); other.disconnectFromFallThroughAndTargets(); other.Parent = null; }
// Merge two blocks into one public void merge(Block other) { if (!canMerge(other)) throw new ApplicationException("Can't merge the two blocks!"); removeLastBr(); // Get rid of last br/br.s if present var newInstructions = new List<Instr>(); addInstructions(newInstructions, instructions); addInstructions(newInstructions, other.instructions); instructions = newInstructions; disconnectFromFallThroughAndTargets(); if (other.targets != null) targets = new List<Block>(other.targets); else targets = null; fallThrough = other.fallThrough; other.disconnectFromFallThroughAndTargets(); other.Parent = null; updateSources(); }
// Merge two blocks into one public void merge(Block other) { if (!canMerge(other)) throw new ApplicationException("Can't merge the two blocks!"); append(other); other.disconnectFromFallThroughAndTargets(); other.Parent = null; }