From 9a4c0bae82cf04e318a4d41c4103b204547f57db Mon Sep 17 00:00:00 2001 From: Joao Matos Date: Thu, 23 Feb 2017 18:14:37 +0000 Subject: [PATCH] Renamed RawCommentKind to CommentKind. --- src/AST/Comment.cs | 54 +++++++++---------- src/Generator/Generators/CLI/CLIHeaders.cs | 2 +- src/Generator/Generators/CLI/CLISources.cs | 2 +- .../Generators/CSharp/CSharpSources.cs | 2 +- src/Generator/Generators/CodeGenerator.cs | 4 +- src/Parser/ASTConverter.cs | 18 +++---- 6 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/AST/Comment.cs b/src/AST/Comment.cs index a39246b6..f6685c93 100644 --- a/src/AST/Comment.cs +++ b/src/AST/Comment.cs @@ -4,9 +4,9 @@ using System.Collections.Generic; namespace CppSharp.AST { /// - /// Raw comment kind. + /// Comment kind. /// - public enum RawCommentKind + public enum CommentKind { // Invalid comment. Invalid, @@ -53,7 +53,7 @@ namespace CppSharp.AST /// /// Kind of the comment. /// - public RawCommentKind Kind; + public CommentKind Kind; /// /// Raw text of the comment. @@ -70,7 +70,7 @@ namespace CppSharp.AST /// public bool IsInvalid { - get { return Kind == RawCommentKind.Invalid; } + get { return Kind == CommentKind.Invalid; } } /// @@ -80,8 +80,8 @@ namespace CppSharp.AST { get { - return Kind == RawCommentKind.OrdinaryBCPL || - Kind == RawCommentKind.OrdinaryC; + return Kind == CommentKind.OrdinaryBCPL || + Kind == CommentKind.OrdinaryC; } } @@ -127,55 +127,55 @@ namespace CppSharp.AST public abstract void Visit(ICommentVisitor visitor); - public static string GetMultiLineCommentPrologue(RawCommentKind kind) + public static string GetMultiLineCommentPrologue(CommentKind kind) { switch (kind) { - case RawCommentKind.OrdinaryBCPL: - case RawCommentKind.BCPLExcl: + case CommentKind.OrdinaryBCPL: + case CommentKind.BCPLExcl: return "//"; - case RawCommentKind.OrdinaryC: - case RawCommentKind.JavaDoc: - case RawCommentKind.Qt: + case CommentKind.OrdinaryC: + case CommentKind.JavaDoc: + case CommentKind.Qt: return " *"; - case RawCommentKind.BCPLSlash: + case CommentKind.BCPLSlash: return "///"; default: throw new ArgumentOutOfRangeException(); } } - public static string GetLineCommentPrologue(RawCommentKind kind) + public static string GetLineCommentPrologue(CommentKind kind) { switch (kind) { - case RawCommentKind.OrdinaryBCPL: - case RawCommentKind.BCPLSlash: + case CommentKind.OrdinaryBCPL: + case CommentKind.BCPLSlash: return string.Empty; - case RawCommentKind.OrdinaryC: + case CommentKind.OrdinaryC: return "/*"; - case RawCommentKind.BCPLExcl: + case CommentKind.BCPLExcl: return "//!"; - case RawCommentKind.JavaDoc: + case CommentKind.JavaDoc: return "/**"; - case RawCommentKind.Qt: + case CommentKind.Qt: return "/*!"; default: throw new ArgumentOutOfRangeException(); } } - public static string GetLineCommentEpilogue(RawCommentKind kind) + public static string GetLineCommentEpilogue(CommentKind kind) { switch (kind) { - case RawCommentKind.OrdinaryBCPL: - case RawCommentKind.BCPLSlash: - case RawCommentKind.BCPLExcl: + case CommentKind.OrdinaryBCPL: + case CommentKind.BCPLSlash: + case CommentKind.BCPLExcl: return string.Empty; - case RawCommentKind.OrdinaryC: - case RawCommentKind.JavaDoc: - case RawCommentKind.Qt: + case CommentKind.OrdinaryC: + case CommentKind.JavaDoc: + case CommentKind.Qt: return " */"; default: throw new ArgumentOutOfRangeException(); diff --git a/src/Generator/Generators/CLI/CLIHeaders.cs b/src/Generator/Generators/CLI/CLIHeaders.cs index fd829082..8320d5ca 100644 --- a/src/Generator/Generators/CLI/CLIHeaders.cs +++ b/src/Generator/Generators/CLI/CLIHeaders.cs @@ -21,7 +21,7 @@ namespace CppSharp.Generators.CLI public override void Process() { - GenerateFilePreamble(RawCommentKind.OrdinaryBCPL); + GenerateFilePreamble(CommentKind.OrdinaryBCPL); PushBlock(CLIBlockKind.Includes); WriteLine("#pragma once"); diff --git a/src/Generator/Generators/CLI/CLISources.cs b/src/Generator/Generators/CLI/CLISources.cs index b4139406..6578c455 100644 --- a/src/Generator/Generators/CLI/CLISources.cs +++ b/src/Generator/Generators/CLI/CLISources.cs @@ -24,7 +24,7 @@ namespace CppSharp.Generators.CLI public override void Process() { - GenerateFilePreamble(RawCommentKind.OrdinaryBCPL); + GenerateFilePreamble(CommentKind.OrdinaryBCPL); var file = Path.GetFileNameWithoutExtension(TranslationUnit.FileName) .Replace('\\', '/'); diff --git a/src/Generator/Generators/CSharp/CSharpSources.cs b/src/Generator/Generators/CSharp/CSharpSources.cs index 872f0e3d..5b024a56 100644 --- a/src/Generator/Generators/CSharp/CSharpSources.cs +++ b/src/Generator/Generators/CSharp/CSharpSources.cs @@ -144,7 +144,7 @@ namespace CppSharp.Generators.CSharp public override void Process() { - GenerateFilePreamble(RawCommentKind.OrdinaryBCPL); + GenerateFilePreamble(CommentKind.OrdinaryBCPL); GenerateUsings(); diff --git a/src/Generator/Generators/CodeGenerator.cs b/src/Generator/Generators/CodeGenerator.cs index c9700eac..e524303e 100644 --- a/src/Generator/Generators/CodeGenerator.cs +++ b/src/Generator/Generators/CodeGenerator.cs @@ -40,7 +40,7 @@ namespace CppSharp.Generators return base.Generate(); } - public void GenerateMultiLineComment(List lines, RawCommentKind kind) + public void GenerateMultiLineComment(List lines, CommentKind kind) { var lineCommentPrologue = Comment.GetLineCommentPrologue(kind); if (!string.IsNullOrWhiteSpace(lineCommentPrologue)) @@ -55,7 +55,7 @@ namespace CppSharp.Generators WriteLine("{0}", lineCommentEpilogue); } - public virtual void GenerateFilePreamble(RawCommentKind kind) + public virtual void GenerateFilePreamble(CommentKind kind) { var lines = new List { diff --git a/src/Parser/ASTConverter.cs b/src/Parser/ASTConverter.cs index 5e6388a0..775d8382 100644 --- a/src/Parser/ASTConverter.cs +++ b/src/Parser/ASTConverter.cs @@ -887,26 +887,26 @@ namespace CppSharp return _rawComment; } - private AST.RawCommentKind ConvertRawCommentKind(RawCommentKind kind) + private AST.CommentKind ConvertRawCommentKind(RawCommentKind kind) { switch (kind) { case RawCommentKind.Invalid: - return AST.RawCommentKind.Invalid; + return AST.CommentKind.Invalid; case RawCommentKind.OrdinaryBCPL: - return AST.RawCommentKind.OrdinaryBCPL; + return AST.CommentKind.OrdinaryBCPL; case RawCommentKind.OrdinaryC: - return AST.RawCommentKind.OrdinaryC; + return AST.CommentKind.OrdinaryC; case RawCommentKind.BCPLSlash: - return AST.RawCommentKind.BCPLSlash; + return AST.CommentKind.BCPLSlash; case RawCommentKind.BCPLExcl: - return AST.RawCommentKind.BCPLExcl; + return AST.CommentKind.BCPLExcl; case RawCommentKind.JavaDoc: - return AST.RawCommentKind.JavaDoc; + return AST.CommentKind.JavaDoc; case RawCommentKind.Qt: - return AST.RawCommentKind.Qt; + return AST.CommentKind.Qt; case RawCommentKind.Merged: - return AST.RawCommentKind.Merged; + return AST.CommentKind.Merged; default: throw new ArgumentOutOfRangeException("kind"); }