Author: gonzalo
Date: 2006-09-19 01:12:48 -0400 (Tue, 19 Sep 2006)
New Revision: 65620

Modified:
   trunk/mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs
   trunk/mcs/class/System/Microsoft.CSharp/ChangeLog
Log:
2006-09-19 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>

        * CSharpCodeGenerator.cs: indent comment lines after the first one and
        speed it up a little bit.



Modified: trunk/mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs
===================================================================
--- trunk/mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs      
2006-09-19 00:34:07 UTC (rev 65619)
+++ trunk/mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs      
2006-09-19 05:12:48 UTC (rev 65620)
@@ -343,6 +343,7 @@
                        Output.WriteLine (";");
                }
 
+               static char [] crlf = new char [] { '\r', '\n' };
                protected override void GenerateComment (CodeComment comment)
                {
                        TextWriter output = Output;
@@ -355,22 +356,14 @@
                                commentChars = "//";
                        }
 
-                       output.Write (commentChars);
-                       output.Write (' ');
-                       string text = comment.Text;
-
-                       for (int i = 0; i < text.Length; i++) {
-                               output.Write (text[i]);
-                               if (text[i] == '\r') {
-                                       if (i < (text.Length - 1) && text[i + 
1] == '\n') {
-                                               continue;
-                                       }
+                       string [] text = comment.Text.Split (crlf);
+                       foreach (string t in text) {
+                               if (t != "") {
                                        output.Write (commentChars);
-                               } else if (text[i] == '\n') {
-                                       output.Write (commentChars);
+                                       output.Write (' ');
+                                       output.WriteLine (t);
                                }
                        }
-
                        output.WriteLine ();
                }
 

Modified: trunk/mcs/class/System/Microsoft.CSharp/ChangeLog
===================================================================
--- trunk/mcs/class/System/Microsoft.CSharp/ChangeLog   2006-09-19 00:34:07 UTC 
(rev 65619)
+++ trunk/mcs/class/System/Microsoft.CSharp/ChangeLog   2006-09-19 05:12:48 UTC 
(rev 65620)
@@ -1,3 +1,8 @@
+2006-09-19 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
+       * CSharpCodeGenerator.cs: indent comment lines after the first one and
+       speed it up a little bit.
+
 2006-08-08  Gert Driesen <[EMAIL PROTECTED]>
 
        * CSharpCodeCompiler.cs: Added support for embedded resources, fixes

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to