Browse Source

Fixed the generator to use blocks for templates and variables.

Fixes wrong whitespace between those declarations.
pull/144/head
triton 12 years ago
parent
commit
dbac9e36fa
  1. 8
      src/Generator/Generators/CLI/CLIHeadersTemplate.cs
  2. 2
      src/Generator/Generators/CLI/CLITextTemplate.cs

8
src/Generator/Generators/CLI/CLIHeadersTemplate.cs

@ -317,6 +317,8 @@ namespace CppSharp.Generators.CLI @@ -317,6 +317,8 @@ namespace CppSharp.Generators.CLI
var functionTemplate = template as FunctionTemplate;
if (functionTemplate == null) continue;
PushBlock(CLIBlockKind.Template);
var function = functionTemplate.TemplatedFunction;
var typeCtx = new CLITypePrinterContext()
@ -339,6 +341,8 @@ namespace CppSharp.Generators.CLI @@ -339,6 +341,8 @@ namespace CppSharp.Generators.CLI
WriteLine("generic<{0}>", typeNamesStr);
WriteLine("{0} {1}({2});", retType, SafeIdentifier(function.Name),
GenerateParametersList(function.Parameters));
PopBlock(NewLineKind.BeforeNextBlock);
}
PopIndent();
@ -484,6 +488,8 @@ namespace CppSharp.Generators.CLI @@ -484,6 +488,8 @@ namespace CppSharp.Generators.CLI
var type = variable.Type;
PushBlock(CLIBlockKind.Variable);
WriteLine("static property {0} {1}", type, variable.Name);
WriteStartBraceIndent();
@ -494,6 +500,8 @@ namespace CppSharp.Generators.CLI @@ -494,6 +500,8 @@ namespace CppSharp.Generators.CLI
WriteLine("void set({0});", type);
WriteCloseBraceIndent();
PopBlock(NewLineKind.BeforeNextBlock);
}
PopIndent();

2
src/Generator/Generators/CLI/CLITextTemplate.cs

@ -41,6 +41,8 @@ namespace CppSharp.Generators.CLI @@ -41,6 +41,8 @@ namespace CppSharp.Generators.CLI
public const int Function = BlockKind.LAST + 12;
public const int Property = BlockKind.LAST + 13;
public const int Typedef = BlockKind.LAST + 14;
public const int Variable = BlockKind.LAST + 15;
public const int Template = BlockKind.LAST + 16;
}
/// <summary>

Loading…
Cancel
Save