Exemplo n.º 1
0
 // 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;
 }
Exemplo n.º 2
0
        // 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();
        }
Exemplo n.º 3
0
 // 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;
 }