Browse Source

Moved the SplitCamelCase method to the utils.

pull/1/head
triton 13 years ago
parent
commit
ef50c60f00
  1. 9
      src/Generator/Passes/FunctionToStaticMethodPass.cs
  2. 6
      src/Generator/Utils/Utils.cs

9
src/Generator/Passes/FunctionToStaticMethodPass.cs

@ -1,5 +1,4 @@ @@ -1,5 +1,4 @@
using System;
using System.Diagnostics;
using System.Text.RegularExpressions;
namespace Cxxi.Passes
@ -18,7 +17,7 @@ namespace Cxxi.Passes @@ -18,7 +17,7 @@ namespace Cxxi.Passes
if (function.Ignore)
return false;
var types = SplitCamelCase(function.Name);
var types = StringHelpers.SplitCamelCase(function.Name);
if (types.Length == 0)
return false;
@ -54,12 +53,6 @@ namespace Cxxi.Passes @@ -54,12 +53,6 @@ namespace Cxxi.Passes
return true;
}
public static string[] SplitCamelCase(string input)
{
var str = Regex.Replace(input, "([A-Z])", " $1", RegexOptions.Compiled);
return str.Trim().Split();
}
}
public static class FunctionToStaticMethodExtensions

6
src/Generator/Utils/Utils.cs

@ -158,6 +158,12 @@ namespace Cxxi @@ -158,6 +158,12 @@ namespace Cxxi
debugText = Regex.Replace(debugText, " ( )+", " ");
debugText = Regex.Replace(debugText, "\n", "");
}
public static string[] SplitCamelCase(string input)
{
var str = Regex.Replace(input, "([A-Z])", " $1", RegexOptions.Compiled);
return str.Trim().Split();
}
}
public static class AssemblyHelpers

Loading…
Cancel
Save