-// CS1570: XML documentation comment on `Testing.Test.PrivateField2' is not well-formed XML markup (The 'summary' start tag on line 1 position 2 does not match the end tag of 'incorrect'. Line 3, position 3.)
+// CS1570: XML documentation comment on `Testing.Test.PrivateField2' is not well-formed XML markup (The 'summary' start tag on line 1 position 3 does not match the end tag of 'incorrect'. Line 3, position 4.)
// Line: 23
// Compiler options: -doc:dummy.xml -warn:1 -warnaserror
-// CS1570: XML documentation comment on `Testing.Test.PublicProperty2' is not well-formed XML markup (The 'summary' start tag on line 1 position 2 does not match the end tag of 'incorrect'. Line 3, position 3.)
+// CS1570: XML documentation comment on `Testing.Test.PublicProperty2' is not well-formed XML markup (The 'summary' start tag on line 1 position 3 does not match the end tag of 'incorrect'. Line 3, position 4.)
// Line: 32
// Compiler options: -doc:dummy.xml -warn:1 -warnaserror
-// CS1570: XML documentation comment on `Test' is not well-formed XML markup (Unexpected XML declaration. The XML declaration must be the first node in the document, and no white space characters are allowed to appear before it. Line 3, position 3.)
+// CS1570: XML documentation comment on `Test' is not well-formed XML markup (Unexpected XML declaration. The XML declaration must be the first node in the document, and no white space characters are allowed to appear before it. Line 3, position 4.)
// Line: 13
// Compiler options: -doc:dummy.xml -warnaserror -warn:1
namespace Testing
{
- /// <summary>
+ ///<summary>
/// Incorrect comment markup.
- /// </incorrect>
+ ///</incorrect>
public class Test2
{
}
namespace Testing
{
- /// <summary>
+ ///<summary>
/// incorrect markup comment for struct
- /// </incorrect>
+ ///</incorrect>
public struct StructTest2
{
}
namespace Testing
{
- /// <summary>
+ ///<summary>
/// incorrect markup comment for interface
- /// </incorrect>
+ ///</incorrect>
public interface InterfaceTest2
{
}
namespace Testing
{
- /// <summary>
+ ///<summary>
/// comment for enum type
- /// </incorrect>
+ ///</incorrect>
enum EnumTest2
{
Foo,
-// CS1570: XML documentation comment on `Testing.MyDelegate2' is not well-formed XML markup (The 'summary' start tag on line 1 position 2 does not match the end tag of 'incorrect'. Line 3, position 3.)
+// CS1570: XML documentation comment on `Testing.MyDelegate2' is not well-formed XML markup (The 'summary' start tag on line 1 position 3 does not match the end tag of 'incorrect'. Line 3, position 4.)
// Line: 12
// Compiler options: -doc:dummy.xml -warn:1 -warnaserror
-// CS1570: XML documentation comment on `Testing.Test2' is not well-formed XML markup (Name cannot begin with the '6' character, hexadecimal value 0x36. Line 1, position 2.)
+// CS1570: XML documentation comment on `Testing.Test2' is not well-formed XML markup (Name cannot begin with the '6' character, hexadecimal value 0x36. Line 1, position 3.)
// Line: 9
// Compiler options: -doc:dummy.xml -warn:1 -warnaserror
-// CS1570: XML documentation comment on `Testing.Test.Constant2' is not well-formed XML markup (The 'summary' start tag on line 1 position 2 does not match the end tag of 'invalid'. Line 3, position 3.)
+// CS1570: XML documentation comment on `Testing.Test.Constant2' is not well-formed XML markup (The 'summary' start tag on line 1 position 3 does not match the end tag of 'invalid'. Line 3, position 4.)
// Line: 19
// Compiler options: -doc:dummy.xml -warn:1 -warnaserror
-// CS1570: XML documentation comment on `Testing.Test.PublicField2' is not well-formed XML markup (The 'summary' start tag on line 1 position 2 does not match the end tag of 'invalid'. Line 3, position 3.)
+// CS1570: XML documentation comment on `Testing.Test.PublicField2' is not well-formed XML markup (The 'summary' start tag on line 1 position 3 does not match the end tag of 'invalid'. Line 3, position 4.)
// Line: 19
// Compiler options: -doc:dummy.xml -warn:1 -warnaserror
-// CS1570: XML documentation comment on `Testing.Test2' is not well-formed XML markup (The 'summary' start tag on line 1 position 2 does not match the end tag of 'incorrect'. Line 3, position 3.)
+// CS1570: XML documentation comment on `Testing.Test2' is not well-formed XML markup (The 'summary' start tag on line 1 position 3 does not match the end tag of 'incorrect'. Line 3, position 4.)
// Line: 12
// Compiler options: -doc:dummy.xml -warnaserror -warn:1
private void handle_one_line_xml_comment ()
{
int c;
- while ((c = peek_char ()) == ' ')
- get_char (); // skip heading whitespaces.
while ((c = peek_char ()) != -1 && c != '\n' && c != '\r') {
xml_comment_buffer.Append ((char) get_char ());
}
el.SetAttribute ("name", name);
string normalized = mc.DocComment;
el.InnerXml = normalized;
- // csc keeps lines as written in the sources
- // and inserts formatting indentation (which
- // is different from XmlTextWriter.Formatting
- // one), but when a start tag contains an
- // endline, it joins the next line. We don't
- // have to follow such a hacky behavior.
- string [] split =
- normalized.Split ('\n');
- int j = 0;
- for (int i = 0; i < split.Length; i++) {
- string s = split [i].TrimEnd ();
- if (s.Length > 0)
- split [j++] = s;
- }
- el.InnerXml = line_head + String.Join (
- line_head, split, 0, j);
+
+ string [] split = normalized.Split ('\n');
+ el.InnerXml = line_head + String.Join (line_head, split);
return el;
} catch (Exception ex) {
Report.Warning (1570, 1, mc.Location, "XML documentation comment on `{0}' is not well-formed XML markup ({1})",
--- /dev/null
+<?xml version="1.0"?>
+<doc>
+ <assembly>
+ <name>test-xml-073</name>
+ </assembly>
+ <members>
+ <member name="T:X">
+ <text>
+ A line
+
+ An indented line
+ </text>
+ </member>
+ </members>
+</doc>
--- /dev/null
+// Compiler options: -doc:xml-073.xml
+///<text>
+///A line
+///
+/// An indented line
+///</text>
+class X
+{
+ public static void Main ()
+ {
+
+ }
+}
\ No newline at end of file