public override void WriteTo(ITextOutput output, MemberMapping memberMapping) { var startLoc = output.Location; output.Write("switch", TextTokenKind.Keyword); output.WriteSpace(); output.Write("(", TextTokenKind.Operator); Condition.WriteTo(output, null); output.Write(")", TextTokenKind.Operator); var ilRanges = new List <ILRange>(ILRanges); ilRanges.AddRange(Condition.GetSelfAndChildrenRecursiveILRanges()); UpdateMemberMapping(memberMapping, startLoc, output.Location, ilRanges); output.WriteSpace(); WriteHiddenStart(output, memberMapping); foreach (CaseBlock caseBlock in this.CaseBlocks) { caseBlock.WriteTo(output, memberMapping); } WriteHiddenEnd(output, memberMapping); }
public override void WriteTo(ITextOutput output, MemberMapping memberMapping) { var startLoc = output.Location; output.Write("if", TextTokenKind.Keyword); output.WriteSpace(); output.Write("(", TextTokenKind.Operator); Condition.WriteTo(output, null); output.Write(")", TextTokenKind.Operator); var ilRanges = new List <ILRange>(ILRanges); ilRanges.AddRange(Condition.GetSelfAndChildrenRecursiveILRanges()); UpdateMemberMapping(memberMapping, startLoc, output.Location, ilRanges); output.WriteSpace(); TrueBlock.WriteTo(output, memberMapping); if (FalseBlock != null) { output.Write("else", TextTokenKind.Keyword); output.WriteSpace(); FalseBlock.WriteTo(output, memberMapping); } }