llcppsigfetch:keep line break

This commit is contained in:
luoliwoshang
2024-09-23 17:16:16 +08:00
parent 074090a0aa
commit 81bd225ff7
2 changed files with 29 additions and 29 deletions

View File

@@ -259,7 +259,7 @@ func (ct *Converter) ParseComment(rawComment string) *ast.CommentGroup {
lines := strings.Split(rawComment, "\n") lines := strings.Split(rawComment, "\n")
commentGroup := &ast.CommentGroup{} commentGroup := &ast.CommentGroup{}
for _, line := range lines { for _, line := range lines {
commentGroup.List = append(commentGroup.List, &ast.Comment{Text: line}) commentGroup.List = append(commentGroup.List, &ast.Comment{Text: line + "\n"})
} }
return commentGroup return commentGroup
} }

View File

@@ -99,7 +99,7 @@ TestDoc Case 3:
"_Type": "CommentGroup", "_Type": "CommentGroup",
"List": [{ "List": [{
"_Type": "Comment", "_Type": "Comment",
"Text": "/// doc" "Text": "/// doc\n"
}] }]
}, },
"Parent": null, "Parent": null,
@@ -148,7 +148,7 @@ TestDoc Case 4:
"_Type": "CommentGroup", "_Type": "CommentGroup",
"List": [{ "List": [{
"_Type": "Comment", "_Type": "Comment",
"Text": "/** doc */" "Text": "/** doc */\n"
}] }]
}, },
"Parent": null, "Parent": null,
@@ -197,7 +197,7 @@ TestDoc Case 5:
"_Type": "CommentGroup", "_Type": "CommentGroup",
"List": [{ "List": [{
"_Type": "Comment", "_Type": "Comment",
"Text": "/*! doc */" "Text": "/*! doc */\n"
}] }]
}, },
"Parent": null, "Parent": null,
@@ -246,10 +246,10 @@ TestDoc Case 6:
"_Type": "CommentGroup", "_Type": "CommentGroup",
"List": [{ "List": [{
"_Type": "Comment", "_Type": "Comment",
"Text": "/// doc 1" "Text": "/// doc 1\n"
}, { }, {
"_Type": "Comment", "_Type": "Comment",
"Text": "/// doc 2" "Text": "/// doc 2\n"
}] }]
}, },
"Parent": null, "Parent": null,
@@ -298,10 +298,10 @@ TestDoc Case 7:
"_Type": "CommentGroup", "_Type": "CommentGroup",
"List": [{ "List": [{
"_Type": "Comment", "_Type": "Comment",
"Text": "/*! doc 1 */" "Text": "/*! doc 1 */\n"
}, { }, {
"_Type": "Comment", "_Type": "Comment",
"Text": "/*! doc 2 */" "Text": "/*! doc 2 */\n"
}] }]
}, },
"Parent": null, "Parent": null,
@@ -350,10 +350,10 @@ TestDoc Case 8:
"_Type": "CommentGroup", "_Type": "CommentGroup",
"List": [{ "List": [{
"_Type": "Comment", "_Type": "Comment",
"Text": "/** doc 1 */" "Text": "/** doc 1 */\n"
}, { }, {
"_Type": "Comment", "_Type": "Comment",
"Text": "/** doc 1 */" "Text": "/** doc 1 */\n"
}] }]
}, },
"Parent": null, "Parent": null,
@@ -402,16 +402,16 @@ TestDoc Case 9:
"_Type": "CommentGroup", "_Type": "CommentGroup",
"List": [{ "List": [{
"_Type": "Comment", "_Type": "Comment",
"Text": "/**" "Text": "/**\n"
}, { }, {
"_Type": "Comment", "_Type": "Comment",
"Text": " * doc 1" "Text": " * doc 1\n"
}, { }, {
"_Type": "Comment", "_Type": "Comment",
"Text": " * doc 2" "Text": " * doc 2\n"
}, { }, {
"_Type": "Comment", "_Type": "Comment",
"Text": " */" "Text": " */\n"
}] }]
}, },
"Parent": null, "Parent": null,
@@ -478,7 +478,7 @@ TestDoc Case 10:
"_Type": "CommentGroup", "_Type": "CommentGroup",
"List": [{ "List": [{
"_Type": "Comment", "_Type": "Comment",
"Text": "/// doc" "Text": "/// doc\n"
}] }]
}, },
"Comment": null, "Comment": null,
@@ -500,7 +500,7 @@ TestDoc Case 10:
"_Type": "CommentGroup", "_Type": "CommentGroup",
"List": [{ "List": [{
"_Type": "Comment", "_Type": "Comment",
"Text": "///< comment" "Text": "///< comment\n"
}] }]
}, },
"IsStatic": false, "IsStatic": false,
@@ -521,7 +521,7 @@ TestDoc Case 10:
"_Type": "CommentGroup", "_Type": "CommentGroup",
"List": [{ "List": [{
"_Type": "Comment", "_Type": "Comment",
"Text": "/*!< comment */" "Text": "/*!< comment */\n"
}] }]
}, },
"IsStatic": false, "IsStatic": false,
@@ -572,13 +572,13 @@ TestDoc Case 11:
"_Type": "CommentGroup", "_Type": "CommentGroup",
"List": [{ "List": [{
"_Type": "Comment", "_Type": "Comment",
"Text": "/** " "Text": "/** \n"
}, { }, {
"_Type": "Comment", "_Type": "Comment",
"Text": " * static field doc" "Text": " * static field doc\n"
}, { }, {
"_Type": "Comment", "_Type": "Comment",
"Text": " */" "Text": " */\n"
}] }]
}, },
"Comment": null, "Comment": null,
@@ -600,7 +600,7 @@ TestDoc Case 11:
"_Type": "CommentGroup", "_Type": "CommentGroup",
"List": [{ "List": [{
"_Type": "Comment", "_Type": "Comment",
"Text": "/*!< static field comment */" "Text": "/*!< static field comment */\n"
}] }]
}, },
"IsStatic": true, "IsStatic": true,
@@ -620,13 +620,13 @@ TestDoc Case 11:
"_Type": "CommentGroup", "_Type": "CommentGroup",
"List": [{ "List": [{
"_Type": "Comment", "_Type": "Comment",
"Text": "/** " "Text": "/** \n"
}, { }, {
"_Type": "Comment", "_Type": "Comment",
"Text": " * field doc" "Text": " * field doc\n"
}, { }, {
"_Type": "Comment", "_Type": "Comment",
"Text": " */" "Text": " */\n"
}] }]
}, },
"Comment": null, "Comment": null,
@@ -648,7 +648,7 @@ TestDoc Case 11:
"_Type": "CommentGroup", "_Type": "CommentGroup",
"List": [{ "List": [{
"_Type": "Comment", "_Type": "Comment",
"Text": "///< field comment" "Text": "///< field comment\n"
}] }]
}, },
"IsStatic": false, "IsStatic": false,
@@ -669,7 +669,7 @@ TestDoc Case 11:
"_Type": "CommentGroup", "_Type": "CommentGroup",
"List": [{ "List": [{
"_Type": "Comment", "_Type": "Comment",
"Text": "/*!< protected field comment */" "Text": "/*!< protected field comment */\n"
}] }]
}, },
"IsStatic": false, "IsStatic": false,
@@ -690,13 +690,13 @@ TestDoc Case 11:
"_Type": "CommentGroup", "_Type": "CommentGroup",
"List": [{ "List": [{
"_Type": "Comment", "_Type": "Comment",
"Text": "/** " "Text": "/** \n"
}, { }, {
"_Type": "Comment", "_Type": "Comment",
"Text": " * method doc" "Text": " * method doc\n"
}, { }, {
"_Type": "Comment", "_Type": "Comment",
"Text": " */" "Text": " */\n"
}] }]
}, },
"Parent": { "Parent": {