Browse Source

Remove leftover Role constants after the Role hierarchy deletion

pull/3807/head
Siegfried Pammer 3 weeks ago committed by Siegfried Pammer
parent
commit
7218d95016
  1. 2
      ICSharpCode.Decompiler.Generators/DecompilerSyntaxTreeGenerator.cs
  2. 2
      ICSharpCode.Decompiler/CSharp/Syntax/AstNodeCollection.cs
  3. 2
      ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AssignmentExpression.cs
  4. 2
      ICSharpCode.Decompiler/CSharp/Syntax/PatternMatching/Pattern.cs
  5. 2
      ICSharpCode.Decompiler/CSharp/Syntax/Roles.cs
  6. 5
      ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/EntityDeclaration.cs
  7. 2
      ICSharpCode.Decompiler/CSharp/Transforms/TransformFieldAndConstructorInitializers.cs

2
ICSharpCode.Decompiler.Generators/DecompilerSyntaxTreeGenerator.cs

@ -67,7 +67,7 @@ internal class DecompilerSyntaxTreeGenerator : IIncrementalGenerator @@ -67,7 +67,7 @@ internal class DecompilerSyntaxTreeGenerator : IIncrementalGenerator
var astNodeType = (INamedTypeSymbol)context.SemanticModel.GetSpeculativeSymbolInfo(context.TargetNode.Span.Start, SyntaxFactory.ParseTypeName("AstNode"), SpeculativeBindingOption.BindAsTypeOrNamespace).Symbol!;
var entityDeclarationType = context.SemanticModel.GetSpeculativeSymbolInfo(context.TargetNode.Span.Start, SyntaxFactory.ParseTypeName("EntityDeclaration"), SpeculativeBindingOption.BindAsTypeOrNamespace).Symbol as INamedTypeSymbol;
// EntityDeclaration declares Name (over Roles.Identifier), ReturnType, and the attributes/modifiers
// EntityDeclaration declares Name (a NameSlot over its Identifier token), ReturnType, and the attributes/modifiers
// helper as virtual members on the base; a subclass overrides them, so the property scan (which
// skips overrides) misses them. Add them explicitly for every EntityDeclaration-derived node. The
// NameToken slot is intentionally not matched, since the Name string already covers it.

2
ICSharpCode.Decompiler/CSharp/Syntax/AstNodeCollection.cs

@ -300,7 +300,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax @@ -300,7 +300,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax
internal bool DoMatch(AstNodeCollection<T> other, Match match)
{
// Both collections are already the per-role child lists, so the matcher walks them by index.
// Both collections are already the per-slot child lists, so the matcher walks them by index.
return Pattern.DoMatchCollection(AsNodeList(), other.AsNodeList(), match);
}

2
ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AssignmentExpression.cs

@ -37,8 +37,6 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax @@ -37,8 +37,6 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax
[DecompilerAstNode]
public sealed partial class AssignmentExpression : Expression
{
// reuse roles from BinaryOperatorExpression
public const string AssignToken = "=";
public const string AddToken = "+=";
public const string SubtractToken = "-=";

2
ICSharpCode.Decompiler/CSharp/Syntax/PatternMatching/Pattern.cs

@ -58,7 +58,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax.PatternMatching @@ -58,7 +58,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax.PatternMatching
/// <summary>
/// Matches the <paramref name="patternChildren"/> collection against the
/// <paramref name="otherChildren"/> collection, with backtracking over Repeat/OptionalNode.
/// Each collection is already the per-role child list, so the match walks them by index.
/// Each collection is already the per-slot child list, so the match walks them by index.
/// </summary>
public static bool DoMatchCollection(IReadOnlyList<INode> patternChildren, IReadOnlyList<INode> otherChildren, Match match)
{

2
ICSharpCode.Decompiler/CSharp/Syntax/Roles.cs

@ -29,8 +29,6 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax @@ -29,8 +29,6 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax
public static class Roles
{
// some pre defined constants for common roles
// some pre defined constants for most used punctuation
public const string LPar = "(";
public const string RPar = ")";

5
ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/EntityDeclaration.cs

@ -25,11 +25,6 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax @@ -25,11 +25,6 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax
{
public abstract class EntityDeclaration : AstNode
{
// Modifiers are stored in the Modifiers scalar; this role only tags the keyword tokens the
// output visitor emits (e.g. for the override-link reference in TextTokenWriter).
// Identity marker for modifier keywords in the output (modifiers are scalars, not child nodes);
// the token writer uses it to make the 'override' modifier a go-to-definition reference.
public abstract SymbolKind SymbolKind { get; }
public virtual AstNodeCollection<AttributeSection> Attributes {

2
ICSharpCode.Decompiler/CSharp/Transforms/TransformFieldAndConstructorInitializers.cs

@ -610,7 +610,7 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms @@ -610,7 +610,7 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms
|| PrimaryConstructorDecl.Initializer is not null
|| TypeDefinition.Kind == TypeKind.Struct;
// HACK: because our current AST model doesn't allow specifying an explicit order of roles,
// HACK: because our current AST model doesn't allow specifying an explicit ordering across slots,
// we have to explicitly insert the primary constructor parameters,
// MoveTo would just append the parameters to the list of children
if (PrimaryConstructorDecl.Parameters.Count > 0)

Loading…
Cancel
Save