diff --git a/ICSharpCode.Decompiler.Generators/DecompilerSyntaxTreeGenerator.cs b/ICSharpCode.Decompiler.Generators/DecompilerSyntaxTreeGenerator.cs index 8ae87ae0d..4f7983da3 100644 --- a/ICSharpCode.Decompiler.Generators/DecompilerSyntaxTreeGenerator.cs +++ b/ICSharpCode.Decompiler.Generators/DecompilerSyntaxTreeGenerator.cs @@ -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. diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/AstNodeCollection.cs b/ICSharpCode.Decompiler/CSharp/Syntax/AstNodeCollection.cs index 8364a695c..2b295ad70 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/AstNodeCollection.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/AstNodeCollection.cs @@ -300,7 +300,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax internal bool DoMatch(AstNodeCollection 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); } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AssignmentExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AssignmentExpression.cs index 89cbef82f..2671911bb 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AssignmentExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/AssignmentExpression.cs @@ -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 = "-="; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/PatternMatching/Pattern.cs b/ICSharpCode.Decompiler/CSharp/Syntax/PatternMatching/Pattern.cs index a73e6cc25..071a115f0 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/PatternMatching/Pattern.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/PatternMatching/Pattern.cs @@ -58,7 +58,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax.PatternMatching /// /// Matches the collection against the /// 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. /// public static bool DoMatchCollection(IReadOnlyList patternChildren, IReadOnlyList otherChildren, Match match) { diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Roles.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Roles.cs index 267ebb437..f5c065587 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Roles.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Roles.cs @@ -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 = ")"; diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/EntityDeclaration.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/EntityDeclaration.cs index a2e63a988..c38ba9aa2 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/EntityDeclaration.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeMembers/EntityDeclaration.cs @@ -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 Attributes { diff --git a/ICSharpCode.Decompiler/CSharp/Transforms/TransformFieldAndConstructorInitializers.cs b/ICSharpCode.Decompiler/CSharp/Transforms/TransformFieldAndConstructorInitializers.cs index 85c4d42b3..f17092a0d 100644 --- a/ICSharpCode.Decompiler/CSharp/Transforms/TransformFieldAndConstructorInitializers.cs +++ b/ICSharpCode.Decompiler/CSharp/Transforms/TransformFieldAndConstructorInitializers.cs @@ -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)