internal override bool EncloseBlock(EncloseBlockType type) { // if there's an else block, recurse down that branch if (FalseBlock != null) { return(FalseBlock.EncloseBlock(type)); } else if (type == EncloseBlockType.IfWithoutElse) { // there is no else branch -- we might have to enclose the outer block return(true); } else if (TrueBlock != null) { return(TrueBlock.EncloseBlock(type)); } return(false); }
internal override bool EncloseBlock(EncloseBlockType type) { // if there's an else block, recurse down that branch. // if we aren't forcing braces and the block contains nothing, then we don't // really have a false block. if (FalseBlock != null && (FalseBlock.ForceBraces || FalseBlock.Count > 0)) { return(FalseBlock.EncloseBlock(type)); } else if (type == EncloseBlockType.IfWithoutElse) { // there is no else branch -- we might have to enclose the outer block return(true); } else if (TrueBlock != null) { return(TrueBlock.EncloseBlock(type)); } return(false); }