public static void Write(SwitchCaseExpression switchCaseExpression, IndentedStreamWriter writer)
        {
            writer.WriteLine($"({switchCaseExpression.Expression}) switch");
            writer.OpenBrackets();

            foreach (CaseExpression @case in switchCaseExpression.CaseExpressions)
            {
                writer.WriteLine($"{@case.Case} => {@case.Body},");
            }

            if (switchCaseExpression.DefaultCaseBody is { })
Esempio n. 2
0
        public static void Write(ForEachLoop forEachLoop, IndentedStreamWriter writer)
        {
            var forEachLoopHeadWriter = new ForEachLoopHeadWriter(writer, forEachLoop);

            forEachLoopHeadWriter.Make();

            writer.OpenBrackets();

            var forEachLoopBodyWriter = new ForEachLoopBodyWriter(writer, forEachLoop);

            forEachLoopBodyWriter.Make();

            writer.CloseBrackets();
        }