Exemple #1
0
        private static IEnumerable <IBlockError> GatherErrorsRecursively(CodeblockCollection collection)
        {
            foreach (CodeblockItem item in collection)
            {
                IBlockError error = item.CheckErrors();
                if (error != null)
                {
                    yield return(item.CheckErrors());
                }

                if (item is IControlFlowBlock)
                {
                    var suberrors = GatherErrorsRecursively((item as IControlFlowBlock).Children);
                    foreach (var e in suberrors)
                    {
                        if (e != null)
                        {
                            yield return(error);
                        }
                    }
                }
            }
        }
Exemple #2
0
 public IfElseBlock()
 {
     Children     = new CodeblockCollection();
     ElseChildren = new CodeblockCollection();
 }
Exemple #3
0
 public IfBlock()
 {
     Children = new CodeblockCollection();
 }
 /// <summary>
 /// Creates a new instance of a codeblock system.
 /// </summary>
 public CodeblockSystem()
 {
     Blocks = new CodeblockCollection();
 }
Exemple #5
0
 public WhileTrueLoopBlock()
 {
     Children = new CodeblockCollection();
 }
Exemple #6
0
 public ForLoopBlock()
 {
     Children = new CodeblockCollection();
 }