Exemplo n.º 1
0
        public string VisitBlock(CilAstBlock block)
        {
            const int maxLineLength = 100;
            var       builder       = new StringBuilder();

            foreach (var value in block.Statements)
            {
                string stringValue = value.AcceptVisitor(this);

                for (int i = 0; i < stringValue.Length; i += maxLineLength)
                {
                    int    lineLength = Math.Min(stringValue.Length - i, maxLineLength);
                    string line       = stringValue.Substring(i, lineLength);
                    if (i > 0)
                    {
                        builder.Append("     ");
                    }
                    builder.Append(line);
                    builder.Append("\\l");
                }
            }

            return(builder.ToString());
        }
Exemplo n.º 2
0
 public string VisitBlock(CilAstBlock block)
 {
     return(string.Join("\\l", block.Statements.Select(x => x.AcceptVisitor(this))) + "\\l");
 }