From 7ed58470daad8affd5ba49d99c9fba145a390c7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Kr=C3=BCger?= Date: Fri, 9 Oct 2009 14:13:22 +0000 Subject: * Src/Lexer/CSharp/Lexer.cs: * Src/Lexer/AbstractLexer.cs: Fixed comment text, when comment contains a tag. svn path=/trunk/monodevelop/; revision=143871 --- main/contrib/NRefactory/Project/ChangeLog | 6 ++++++ main/contrib/NRefactory/Project/Src/Lexer/AbstractLexer.cs | 9 +++++++-- main/contrib/NRefactory/Project/Src/Lexer/CSharp/Lexer.cs | 4 +--- 3 files changed, 14 insertions(+), 5 deletions(-) (limited to 'main/contrib') diff --git a/main/contrib/NRefactory/Project/ChangeLog b/main/contrib/NRefactory/Project/ChangeLog index 056de86e75..daf4626041 100644 --- a/main/contrib/NRefactory/Project/ChangeLog +++ b/main/contrib/NRefactory/Project/ChangeLog @@ -1,3 +1,9 @@ +2009-10-09 Mike Krüger + + * Src/Lexer/CSharp/Lexer.cs: + * Src/Lexer/AbstractLexer.cs: Fixed comment text, when comment + contains a tag. + 2009-10-08 Mike Krüger * NRefactory.csproj: diff --git a/main/contrib/NRefactory/Project/Src/Lexer/AbstractLexer.cs b/main/contrib/NRefactory/Project/Src/Lexer/AbstractLexer.cs index 3dd0f01bb1..898ddcf3d9 100644 --- a/main/contrib/NRefactory/Project/Src/Lexer/AbstractLexer.cs +++ b/main/contrib/NRefactory/Project/Src/Lexer/AbstractLexer.cs @@ -1,4 +1,4 @@ -// +// // // // @@ -299,7 +299,12 @@ namespace ICSharpCode.NRefactory.Parser protected string ReadToEndOfLine() { - sb.Length = 0; + return ReadToEndOfLine (true); + } + protected string ReadToEndOfLine(bool resetBuilder) + { + if (resetBuilder) + sb.Length = 0; int nextChar; while ((nextChar = reader.Read()) != -1) { char ch = (char)nextChar; diff --git a/main/contrib/NRefactory/Project/Src/Lexer/CSharp/Lexer.cs b/main/contrib/NRefactory/Project/Src/Lexer/CSharp/Lexer.cs index f76f74b67b..78639c7371 100644 --- a/main/contrib/NRefactory/Project/Src/Lexer/CSharp/Lexer.cs +++ b/main/contrib/NRefactory/Project/Src/Lexer/CSharp/Lexer.cs @@ -816,7 +816,6 @@ namespace ICSharpCode.NRefactory.Parser.CSharp } sb.Length = 0; StringBuilder curWord = new StringBuilder(); - int nextChar; while ((nextChar = ReaderRead()) != -1) { char ch = (char)nextChar; @@ -833,9 +832,8 @@ namespace ICSharpCode.NRefactory.Parser.CSharp curWord.Length = 0; if (specialCommentHash.ContainsKey(tag)) { Location p = new Location(Col, Line); - string comment = ch + ReadToEndOfLine(); + string comment = ch + ReadToEndOfLine(false); this.TagComments.Add(new TagComment(tag, comment, isAtLineBegin, p, new Location(Col, Line))); - sb.Append(comment); break; } } -- cgit v1.2.3