diff options
author | matthewsotoudeh <matthewsot@outlook.com> | 2014-11-28 00:21:54 -0800 |
---|---|---|
committer | matthewsotoudeh <matthewsot@outlook.com> | 2014-11-28 00:21:54 -0800 |
commit | e5731e2dcc3c1b0f977d30194f25076c6c05ff98 (patch) | |
tree | 48bb3d98ddfad5b5a5740384a667585133577b16 | |
parent | 97f83a7f8fc3e7a0852e14d2686d88a6b195320e (diff) |
commented up TypeParser
-rw-r--r-- | SharpSwift/SharpSwift/Converters/TypeParser.cs | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/SharpSwift/SharpSwift/Converters/TypeParser.cs b/SharpSwift/SharpSwift/Converters/TypeParser.cs index 2472c6e..f1bf2de 100644 --- a/SharpSwift/SharpSwift/Converters/TypeParser.cs +++ b/SharpSwift/SharpSwift/Converters/TypeParser.cs @@ -8,6 +8,7 @@ namespace SharpSwift.Converters /// Returns the Swift equivilant for a C# type /// </summary> /// <param name="typeName">The C# type's identifier as a string</param> + /// <param name="implyUnwrapped">If true, unwraps the type with an ! at the end</param> /// <returns>The Swift equivilant type as a string</returns> private static string Type(string typeName, bool implyUnwrapped = true) { @@ -27,16 +28,26 @@ namespace SharpSwift.Converters return typeName + (implyUnwrapped ? "!" : ""); } + /// <summary> + /// Converts an array type to Swift + /// </summary> + /// <param name="array">The array type to convert</param> + /// <returns>The converted Swift type</returns> [ParsesType(typeof (ArrayTypeSyntax))] - public static string ArrayType(ArrayTypeSyntax node) + public static string ArrayType(ArrayTypeSyntax array) { - return "[" + SyntaxNode(node.ElementType) + "]"; //TODO: rankspecifiers + return "[" + SyntaxNode(array.ElementType) + "]"; //TODO: rankspecifiers } + /// <summary> + /// Converts a PredefinedType to Swift + /// </summary> + /// <param name="type">The type to convert</param> + /// <returns>The converted Swift type</returns> [ParsesType(typeof (PredefinedTypeSyntax))] - public static string PredefinedType(PredefinedTypeSyntax node) + public static string PredefinedType(PredefinedTypeSyntax type) { - return Type(node.Keyword.Text); + return Type(type.Keyword.Text); } } } |