Browse Source

Rename IDiagnosticConsumer to IDiagnostics.

pull/696/head
Joao Matos 10 years ago
parent
commit
41719e641e
  1. 14
      src/Core/Diagnostics.cs
  2. 4
      src/Generator/Driver.cs
  3. 2
      src/Generator/Generators/Template.cs
  4. 4
      src/Generator/Passes/CheckDuplicatedNamesPass.cs
  5. 4
      src/Generator/Passes/GetterSetterToPropertyAdvancedPass.cs
  6. 2
      src/Generator/Passes/Pass.cs

14
src/Core/Diagnostics.cs

@ -28,7 +28,7 @@ namespace CppSharp @@ -28,7 +28,7 @@ namespace CppSharp
public int Column;
}
public interface IDiagnosticConsumer
public interface IDiagnostics
{
void Emit(DiagnosticInfo info);
void PushIndent(int level);
@ -37,7 +37,7 @@ namespace CppSharp @@ -37,7 +37,7 @@ namespace CppSharp
public static class DiagnosticExtensions
{
public static void Debug(this IDiagnosticConsumer consumer,
public static void Debug(this IDiagnostics consumer,
string msg, params object[] args)
{
var diagInfo = new DiagnosticInfo
@ -49,7 +49,7 @@ namespace CppSharp @@ -49,7 +49,7 @@ namespace CppSharp
consumer.Emit(diagInfo);
}
public static void Message(this IDiagnosticConsumer consumer,
public static void Message(this IDiagnostics consumer,
string msg, params object[] args)
{
var diagInfo = new DiagnosticInfo
@ -61,7 +61,7 @@ namespace CppSharp @@ -61,7 +61,7 @@ namespace CppSharp
consumer.Emit(diagInfo);
}
public static void Warning(this IDiagnosticConsumer consumer,
public static void Warning(this IDiagnostics consumer,
string msg, params object[] args)
{
var diagInfo = new DiagnosticInfo
@ -73,7 +73,7 @@ namespace CppSharp @@ -73,7 +73,7 @@ namespace CppSharp
consumer.Emit(diagInfo);
}
public static void Error(this IDiagnosticConsumer consumer,
public static void Error(this IDiagnostics consumer,
string msg, params object[] args)
{
var diagInfo = new DiagnosticInfo
@ -85,7 +85,7 @@ namespace CppSharp @@ -85,7 +85,7 @@ namespace CppSharp
consumer.Emit(diagInfo);
}
public static void Error(this IDiagnosticConsumer consumer,
public static void Error(this IDiagnostics consumer,
string msg)
{
var diagInfo = new DiagnosticInfo
@ -98,7 +98,7 @@ namespace CppSharp @@ -98,7 +98,7 @@ namespace CppSharp
}
}
public class TextDiagnosticPrinter : IDiagnosticConsumer
public class TextDiagnosticPrinter : IDiagnostics
{
public Stack<int> Indents;
public DiagnosticKind Level;

4
src/Generator/Driver.cs

@ -20,7 +20,7 @@ namespace CppSharp @@ -20,7 +20,7 @@ namespace CppSharp
{
public class Driver
{
public IDiagnosticConsumer Diagnostics { get; set; }
public IDiagnostics Diagnostics { get; set; }
public DriverOptions Options { get; private set; }
public Project Project { get; private set; }
@ -39,7 +39,7 @@ namespace CppSharp @@ -39,7 +39,7 @@ namespace CppSharp
private static readonly Dictionary<string, string> libraryMappings = new Dictionary<string, string>();
public Driver(DriverOptions options, IDiagnosticConsumer diagnostics)
public Driver(DriverOptions options, IDiagnostics diagnostics)
{
Options = options;
Diagnostics = diagnostics;

2
src/Generator/Generators/Template.cs

@ -286,7 +286,7 @@ namespace CppSharp.Generators @@ -286,7 +286,7 @@ namespace CppSharp.Generators
public TranslationUnit TranslationUnit { get { return TranslationUnits[0]; } }
public IDiagnosticConsumer Log
public IDiagnostics Log
{
get { return Driver.Diagnostics; }
}

4
src/Generator/Passes/CheckDuplicatedNamesPass.cs

@ -11,9 +11,9 @@ namespace CppSharp.Passes @@ -11,9 +11,9 @@ namespace CppSharp.Passes
{
private readonly Dictionary<string, int> methodSignatures;
private int Count;
private readonly IDiagnosticConsumer diagnostics;
private readonly IDiagnostics diagnostics;
public DeclarationName(IDiagnosticConsumer diagnostics)
public DeclarationName(IDiagnostics diagnostics)
{
this.diagnostics = diagnostics;
methodSignatures = new Dictionary<string, int>();

4
src/Generator/Passes/GetterSetterToPropertyAdvancedPass.cs

@ -15,13 +15,13 @@ namespace CppSharp.Passes @@ -15,13 +15,13 @@ namespace CppSharp.Passes
{
private class PropertyGenerator
{
private readonly IDiagnosticConsumer log;
private readonly IDiagnostics log;
private readonly List<Method> getters = new List<Method>();
private readonly List<Method> setters = new List<Method>();
private readonly List<Method> setMethods = new List<Method>();
private readonly List<Method> nonSetters = new List<Method>();
public PropertyGenerator(Class @class, IDiagnosticConsumer log)
public PropertyGenerator(Class @class, IDiagnostics log)
{
this.log = log;
foreach (var method in @class.Methods.Where(

2
src/Generator/Passes/Pass.cs

@ -12,7 +12,7 @@ namespace CppSharp.Passes @@ -12,7 +12,7 @@ namespace CppSharp.Passes
public Driver Driver { get; set; }
public ASTContext AstContext { get; set; }
public IDiagnosticConsumer Log
public IDiagnostics Log
{
get { return Driver.Diagnostics; }
}

Loading…
Cancel
Save