[Monodevelop-patches-list] r460 - trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Sun Jan 11 21:05:48 EST 2004


Author: benm
Date: 2004-01-11 21:05:48 -0500 (Sun, 11 Jan 2004)
New Revision: 460

Modified:
   trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Lexer.cs
Log:
dont allocate on single line comments

Modified: trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Lexer.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Lexer.cs	2004-01-12 01:36:44 UTC (rev 459)
+++ trunk/MonoDevelop/src/Libraries/SharpRefactory/src/Lexer/Lexer.cs	2004-01-12 02:05:48 UTC (rev 460)
@@ -937,7 +937,18 @@
 		
 		void ReadSingleLineComment(CommentType commentType)
 		{
-			string comment = ReadToEOL();
+			if (!reader.Eos()) {
+				char ch = reader.GetNext();
+				while (!reader.Eos()) {
+					if (ch == '\n') {
+						++line;
+						col = 1;
+						return;
+					}
+					ch = reader.GetNext();
+					++col;
+				}
+			}
 //			specialTracker.StartComment(commentType, new Point(line, col));
 //			specialTracker.AddString(ReadToEOL());
 //			specialTracker.FinishComment();




More information about the Monodevelop-patches-list mailing list