Browse Source

Renamed Location to MacroLocation in PreprocessedEntity.

We'll use the name Location to represent source locations in declarations.
pull/266/merge
triton 12 years ago
parent
commit
27fa2ca03d
  1. 2
      src/AST/Preprocessor.cs
  2. 2
      src/Core/Parser/ASTConverter.cs
  3. 12
      src/Generator/Passes/CheckMacrosPass.cs

2
src/AST/Preprocessor.cs

@ -16,7 +16,7 @@
/// </summary> /// </summary>
public abstract class PreprocessedEntity : Declaration public abstract class PreprocessedEntity : Declaration
{ {
public MacroLocation Location = MacroLocation.Unknown; public MacroLocation MacroLocation = MacroLocation.Unknown;
} }
/// <summary> /// <summary>

2
src/Core/Parser/ASTConverter.cs

@ -1407,7 +1407,7 @@ namespace CppSharp
void VisitPreprocessedEntity(PreprocessedEntity entity, AST.PreprocessedEntity _entity) void VisitPreprocessedEntity(PreprocessedEntity entity, AST.PreprocessedEntity _entity)
{ {
VisitDeclaration(entity, _entity); VisitDeclaration(entity, _entity);
_entity.Location = VisitMacroLocation(entity.Location); _entity.MacroLocation = VisitMacroLocation(entity.Location);
} }
private AST.MacroLocation VisitMacroLocation(MacroLocation location) private AST.MacroLocation VisitMacroLocation(MacroLocation location)

12
src/Generator/Passes/CheckMacrosPass.cs

@ -71,9 +71,9 @@ namespace CppSharp.Passes
void CheckIgnoreMacros(Declaration decl, IEnumerable<MacroExpansion> expansions) void CheckIgnoreMacros(Declaration decl, IEnumerable<MacroExpansion> expansions)
{ {
if (expansions.Any(e => e.Text == Prefix + "_IGNORE" && if (expansions.Any(e => e.Text == Prefix + "_IGNORE" &&
e.Location != MacroLocation.ClassBody && e.MacroLocation != MacroLocation.ClassBody &&
e.Location != MacroLocation.FunctionBody && e.MacroLocation != MacroLocation.FunctionBody &&
e.Location != MacroLocation.FunctionParameters)) e.MacroLocation != MacroLocation.FunctionParameters))
{ {
Log.Debug("Decl '{0}' was ignored due to ignore macro", Log.Debug("Decl '{0}' was ignored due to ignore macro",
decl.Name); decl.Name);
@ -81,9 +81,9 @@ namespace CppSharp.Passes
} }
if (expansions.Any(e => e.Text == Prefix + "_IGNORE_GEN" && if (expansions.Any(e => e.Text == Prefix + "_IGNORE_GEN" &&
e.Location != MacroLocation.ClassBody && e.MacroLocation != MacroLocation.ClassBody &&
e.Location != MacroLocation.FunctionBody && e.MacroLocation != MacroLocation.FunctionBody &&
e.Location != MacroLocation.FunctionParameters)) e.MacroLocation != MacroLocation.FunctionParameters))
decl.GenerationKind = GenerationKind.Internal; decl.GenerationKind = GenerationKind.Internal;
} }

Loading…
Cancel
Save