Browse Source

Renamed CommentKind to DocumentationCommentKind.

pull/769/head
Joao Matos 9 years ago
parent
commit
b1f7ad6f70
  1. 30
      src/AST/Comment.cs
  2. 28
      src/Generator/Generators/CSharp/CSharpCommentPrinter.cs

30
src/AST/Comment.cs

@ -26,7 +26,7 @@ namespace CppSharp.AST @@ -26,7 +26,7 @@ namespace CppSharp.AST
Merged
}
public enum CommentKind
public enum DocumentationCommentKind
{
FullComment,
BlockContentComment,
@ -123,7 +123,7 @@ namespace CppSharp.AST @@ -123,7 +123,7 @@ namespace CppSharp.AST
/// </summary>
public abstract class Comment
{
public CommentKind Kind { get; set; }
public DocumentationCommentKind Kind { get; set; }
public abstract void Visit<T>(ICommentVisitor<T> visitor);
@ -236,7 +236,7 @@ namespace CppSharp.AST @@ -236,7 +236,7 @@ namespace CppSharp.AST
public BlockCommandComment()
{
Kind = CommentKind.BlockCommandComment;
Kind = DocumentationCommentKind.BlockCommandComment;
Arguments = new List<Argument>();
}
@ -256,7 +256,7 @@ namespace CppSharp.AST @@ -256,7 +256,7 @@ namespace CppSharp.AST
public ParamCommandComment()
{
Kind = CommentKind.ParamCommandComment;
Kind = DocumentationCommentKind.ParamCommandComment;
}
public enum PassDirection
@ -307,7 +307,7 @@ namespace CppSharp.AST @@ -307,7 +307,7 @@ namespace CppSharp.AST
public TParamCommandComment()
{
Kind = CommentKind.TParamCommandComment;
Kind = DocumentationCommentKind.TParamCommandComment;
Position = new List<uint>();
}
@ -328,7 +328,7 @@ namespace CppSharp.AST @@ -328,7 +328,7 @@ namespace CppSharp.AST
public VerbatimBlockComment()
{
Kind = CommentKind.VerbatimBlockComment;
Kind = DocumentationCommentKind.VerbatimBlockComment;
Lines = new List<VerbatimBlockLineComment>();
}
@ -349,7 +349,7 @@ namespace CppSharp.AST @@ -349,7 +349,7 @@ namespace CppSharp.AST
public VerbatimLineComment()
{
Kind = CommentKind.VerbatimLineComment;
Kind = DocumentationCommentKind.VerbatimLineComment;
}
public override void Visit<T>(ICommentVisitor<T> visitor)
@ -369,7 +369,7 @@ namespace CppSharp.AST @@ -369,7 +369,7 @@ namespace CppSharp.AST
public ParagraphComment()
{
Kind = CommentKind.ParagraphComment;
Kind = DocumentationCommentKind.ParagraphComment;
Content = new List<InlineContentComment>();
}
@ -386,7 +386,7 @@ namespace CppSharp.AST @@ -386,7 +386,7 @@ namespace CppSharp.AST
{
protected InlineContentComment()
{
Kind = CommentKind.InlineContentComment;
Kind = DocumentationCommentKind.InlineContentComment;
}
public bool HasTrailingNewline { get; set; }
@ -403,7 +403,7 @@ namespace CppSharp.AST @@ -403,7 +403,7 @@ namespace CppSharp.AST
protected HTMLTagComment()
{
Kind = CommentKind.HTMLTagComment;
Kind = DocumentationCommentKind.HTMLTagComment;
}
}
@ -422,7 +422,7 @@ namespace CppSharp.AST @@ -422,7 +422,7 @@ namespace CppSharp.AST
public HTMLStartTagComment()
{
Kind = CommentKind.HTMLStartTagComment;
Kind = DocumentationCommentKind.HTMLStartTagComment;
Attributes = new List<Attribute>();
}
@ -439,7 +439,7 @@ namespace CppSharp.AST @@ -439,7 +439,7 @@ namespace CppSharp.AST
{
public HTMLEndTagComment()
{
Kind = CommentKind.HTMLEndTagComment;
Kind = DocumentationCommentKind.HTMLEndTagComment;
}
public override void Visit<T>(ICommentVisitor<T> visitor)
@ -457,7 +457,7 @@ namespace CppSharp.AST @@ -457,7 +457,7 @@ namespace CppSharp.AST
public TextComment()
{
Kind = CommentKind.TextComment;
Kind = DocumentationCommentKind.TextComment;
}
public override void Visit<T>(ICommentVisitor<T> visitor)
@ -497,7 +497,7 @@ namespace CppSharp.AST @@ -497,7 +497,7 @@ namespace CppSharp.AST
public InlineCommandComment()
{
Kind = CommentKind.InlineCommandComment;
Kind = DocumentationCommentKind.InlineCommandComment;
Arguments = new List<Argument>();
}
@ -516,7 +516,7 @@ namespace CppSharp.AST @@ -516,7 +516,7 @@ namespace CppSharp.AST
public VerbatimBlockLineComment()
{
Kind = CommentKind.VerbatimBlockLineComment;
Kind = DocumentationCommentKind.VerbatimBlockLineComment;
}
public override void Visit<T>(ICommentVisitor<T> visitor)

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

@ -22,12 +22,12 @@ namespace CppSharp.Generators.CSharp @@ -22,12 +22,12 @@ namespace CppSharp.Generators.CSharp
{
switch (comment.Kind)
{
case CommentKind.FullComment:
case DocumentationCommentKind.FullComment:
var fullComment = (FullComment) comment;
foreach (var block in fullComment.Blocks)
block.GetCommentSections(sections);
break;
case CommentKind.BlockCommandComment:
case DocumentationCommentKind.BlockCommandComment:
var blockCommandComment = (BlockCommandComment) comment;
if (blockCommandComment.CommandKind == CommentCommandKind.Return &&
blockCommandComment.ParagraphComment != null)
@ -36,7 +36,7 @@ namespace CppSharp.Generators.CSharp @@ -36,7 +36,7 @@ namespace CppSharp.Generators.CSharp
blockCommandComment.ParagraphComment.GetCommentSections(sections);
}
break;
case CommentKind.ParamCommandComment:
case DocumentationCommentKind.ParamCommandComment:
var paramCommandComment = (ParamCommandComment) comment;
var param = new Section(CommentElement.Param);
sections.Add(param);
@ -47,13 +47,13 @@ namespace CppSharp.Generators.CSharp @@ -47,13 +47,13 @@ namespace CppSharp.Generators.CSharp
foreach (var inlineContentComment in paramCommandComment.ParagraphComment.Content)
inlineContentComment.GetCommentSections(sections);
break;
case CommentKind.TParamCommandComment:
case DocumentationCommentKind.TParamCommandComment:
break;
case CommentKind.VerbatimBlockComment:
case DocumentationCommentKind.VerbatimBlockComment:
break;
case CommentKind.VerbatimLineComment:
case DocumentationCommentKind.VerbatimLineComment:
break;
case CommentKind.ParagraphComment:
case DocumentationCommentKind.ParagraphComment:
var summaryParagraph = sections.Count == 1;
var paragraphComment = (ParagraphComment) comment;
foreach (var inlineContentComment in paragraphComment.Content)
@ -65,24 +65,24 @@ namespace CppSharp.Generators.CSharp @@ -65,24 +65,24 @@ namespace CppSharp.Generators.CSharp
sections.Add(new Section(CommentElement.Remarks));
}
break;
case CommentKind.HTMLTagComment:
case DocumentationCommentKind.HTMLTagComment:
break;
case CommentKind.HTMLStartTagComment:
case DocumentationCommentKind.HTMLStartTagComment:
break;
case CommentKind.HTMLEndTagComment:
case DocumentationCommentKind.HTMLEndTagComment:
break;
case CommentKind.TextComment:
case DocumentationCommentKind.TextComment:
var section = sections.Last();
section.Lines.Add(GetText(comment,
section.Type == CommentElement.Returns || section.Type == CommentElement.Param));
if (sections.Count == 1)
sections.Add(new Section(CommentElement.Remarks));
break;
case CommentKind.InlineContentComment:
case DocumentationCommentKind.InlineContentComment:
break;
case CommentKind.InlineCommandComment:
case DocumentationCommentKind.InlineCommandComment:
break;
case CommentKind.VerbatimBlockLineComment:
case DocumentationCommentKind.VerbatimBlockLineComment:
break;
}
}

Loading…
Cancel
Save