summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatthewsotoudeh <matthewsot@outlook.com>2014-11-28 00:21:54 -0800
committermatthewsotoudeh <matthewsot@outlook.com>2014-11-28 00:21:54 -0800
commite5731e2dcc3c1b0f977d30194f25076c6c05ff98 (patch)
tree48bb3d98ddfad5b5a5740384a667585133577b16
parent97f83a7f8fc3e7a0852e14d2686d88a6b195320e (diff)
commented up TypeParser
-rw-r--r--SharpSwift/SharpSwift/Converters/TypeParser.cs19
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);
}
}
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback