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); } } } } }
public IfElseBlock() { Children = new CodeblockCollection(); ElseChildren = new CodeblockCollection(); }
public IfBlock() { Children = new CodeblockCollection(); }
/// <summary> /// Creates a new instance of a codeblock system. /// </summary> public CodeblockSystem() { Blocks = new CodeblockCollection(); }
public WhileTrueLoopBlock() { Children = new CodeblockCollection(); }
public ForLoopBlock() { Children = new CodeblockCollection(); }