Browse Source

Checked whether block comments actually have paragraphs.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/642/head
Dimitar Dobrev 10 years ago
parent
commit
11fc1f5097
  1. 1
      src/Core/Parser/ASTConverter.cs
  2. 4
      src/Generator/Generators/CSharp/CSharpCommentPrinter.cs

1
src/Core/Parser/ASTConverter.cs

@ -1752,6 +1752,7 @@ namespace CppSharp @@ -1752,6 +1752,7 @@ namespace CppSharp
private void VisitBlockCommandComment(AST.BlockCommandComment blockCommandComment, BlockCommandComment comment)
{
blockCommandComment.CommandId = comment.CommandId;
if (comment.ParagraphComment != null)
blockCommandComment.ParagraphComment = (AST.ParagraphComment) Visit(comment.ParagraphComment);
for (uint i = 0; i < comment.ArgumentsCount; i++)
{

4
src/Generator/Generators/CSharp/CSharpCommentPrinter.cs

@ -29,7 +29,8 @@ namespace CppSharp.Generators.CSharp @@ -29,7 +29,8 @@ namespace CppSharp.Generators.CSharp
break;
case CommentKind.BlockCommandComment:
var blockCommandComment = (BlockCommandComment) comment;
if (blockCommandComment.CommandKind == CommentCommandKind.Return)
if (blockCommandComment.CommandKind == CommentCommandKind.Return &&
blockCommandComment.ParagraphComment != null)
{
sections.Add(new Section(CommentElement.Returns));
blockCommandComment.ParagraphComment.GetCommentSections(sections);
@ -42,6 +43,7 @@ namespace CppSharp.Generators.CSharp @@ -42,6 +43,7 @@ namespace CppSharp.Generators.CSharp
if (paramCommandComment.Arguments.Count > 0)
param.Attributes.Add(
string.Format("name=\"{0}\"", paramCommandComment.Arguments[0].Text));
if (paramCommandComment.ParagraphComment != null)
foreach (var inlineContentComment in paramCommandComment.ParagraphComment.Content)
inlineContentComment.GetCommentSections(sections);
break;

Loading…
Cancel
Save