Browse Source

Fixed multiple line comment content.

newNRvisualizers
Mike Krüger 15 years ago
parent
commit
a097af0b80
  1. 13
      ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-tokenizer.cs

13
ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-tokenizer.cs

@ -3239,16 +3239,16 @@ namespace Mono.CSharp
bool docAppend = false; bool docAppend = false;
if (doc_processing && peek_char () == '*') { if (doc_processing && peek_char () == '*') {
int ch = get_char (); int ch = get_char ();
if (position_stack.Count == 0)
sbag.PushCommentChar (ch);
// But when it is /**/, just do nothing. // But when it is /**/, just do nothing.
if (peek_char () == '/') { if (peek_char () == '/') {
ch = get_char (); ch = get_char ();
if (position_stack.Count == 0) { if (position_stack.Count == 0) {
sbag.PushCommentChar (ch);
sbag.EndComment (line, col + 1); sbag.EndComment (line, col + 1);
} }
continue; continue;
} else {
if (position_stack.Count == 0)
sbag.PushCommentChar (ch);
} }
if (doc_state == XmlCommentState.Allowed) if (doc_state == XmlCommentState.Allowed)
docAppend = true; docAppend = true;
@ -3264,16 +3264,15 @@ namespace Mono.CSharp
} }
while ((d = get_char ()) != -1){ while ((d = get_char ()) != -1){
if (position_stack.Count == 0)
sbag.PushCommentChar (d);
if (d == '*' && peek_char () == '/'){ if (d == '*' && peek_char () == '/'){
if (position_stack.Count == 0)
sbag.PushCommentChar ('/');
get_char (); get_char ();
if (position_stack.Count == 0) if (position_stack.Count == 0)
sbag.EndComment (line, col + 1); sbag.EndComment (line, col + 1);
comments_seen = true; comments_seen = true;
break; break;
} else {
if (position_stack.Count == 0)
sbag.PushCommentChar (d);
} }
if (docAppend) if (docAppend)
xml_comment_buffer.Append ((char) d); xml_comment_buffer.Append ((char) d);

Loading…
Cancel
Save