private bool WriteEmptyCodeBlock(TranslationBuffer buffer)
        {
            if ((_translation is IPotentialEmptyTranslatable emptyTranslatable) && emptyTranslatable.IsEmpty)
            {
                buffer.WriteClosingBraceToTranslation(startOnNewLine: false);
                return(true);
            }

            return(false);
        }
        public void WriteTo(TranslationBuffer buffer)
        {
            if (_writeBraces)
            {
                buffer.WriteOpeningBraceToTranslation(_startOnNewLine);

                if (WriteEmptyCodeBlock(buffer))
                {
                    return;
                }
            }

            if (_indentContents)
            {
                buffer.Indent();
            }

            if (_writeBraces && _ensureReturnKeyword && !_translation.IsMultiStatement())
            {
                buffer.WriteToTranslation("return ");
            }

            _translation.WriteTo(buffer);

            if (EnsureTerminated())
            {
                buffer.WriteToTranslation(';');
            }

            if (_writeBraces)
            {
                buffer.WriteClosingBraceToTranslation();
            }

            if (_indentContents)
            {
                buffer.Unindent();
            }
        }
        public void WriteTo(TranslationBuffer buffer)
        {
            buffer.WriteToTranslation("switch ");
            _valueTranslation.WriteInParentheses(buffer);
            buffer.WriteOpeningBraceToTranslation();

            for (int i = 0, l = _caseTranslations.Length - 1; ; ++i)
            {
                var caseTestValueTranslations = _caseTestValueTranslations[i];

                for (int j = 0, m = caseTestValueTranslations.Length - 1; ; ++j)
                {
                    buffer.WriteToTranslation("case ");
                    caseTestValueTranslations[j].WriteTo(buffer);
                    buffer.WriteToTranslation(':');
                    buffer.WriteNewLineToTranslation();

                    if (j == m)
                    {
                        break;
                    }
                }

                WriteCaseBody(_caseTranslations[i], buffer);

                if (i == l)
                {
                    break;
                }

                buffer.WriteNewLineToTranslation();
                buffer.WriteNewLineToTranslation();
            }

            WriteDefaultIfPresent(buffer);

            buffer.WriteClosingBraceToTranslation();
        }