diff --git a/ICSharpCode.Decompiler.Generators/DecompilerSyntaxTreeGenerator.cs b/ICSharpCode.Decompiler.Generators/DecompilerSyntaxTreeGenerator.cs index 9a8788058..ed227b617 100644 --- a/ICSharpCode.Decompiler.Generators/DecompilerSyntaxTreeGenerator.cs +++ b/ICSharpCode.Decompiler.Generators/DecompilerSyntaxTreeGenerator.cs @@ -244,6 +244,10 @@ internal class DecompilerSyntaxTreeGenerator : IIncrementalGenerator { builder.Append($"\r\n\t\t\t&& (this.{member} == {typeName}.Any || this.{member} == o.{member})"); } + else if (typeName == "String") + { + builder.Append($"\r\n\t\t\t&& MatchString(this.{member}, o.{member})"); + } else { builder.Append($"\r\n\t\t\t&& this.{member} == o.{member}"); diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CastExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CastExpression.cs index c409fb69e..b8d05a715 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CastExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CastExpression.cs @@ -58,12 +58,6 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax AddChild(castToType, Roles.Type); AddChild(expression, Roles.Expression); } - - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) - { - CastExpression o = other as CastExpression; - return o != null && this.Type.DoMatch(o.Type, match) && this.Expression.DoMatch(o.Expression, match); - } } } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CheckedExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CheckedExpression.cs index 0f674e67b..dacceb8c9 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CheckedExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CheckedExpression.cs @@ -59,11 +59,5 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax { AddChild(expression, Roles.Expression); } - - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) - { - CheckedExpression o = other as CheckedExpression; - return o != null && this.Expression.DoMatch(o.Expression, match); - } } } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ConditionalExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ConditionalExpression.cs index 4e389cfee..809312b9e 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ConditionalExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ConditionalExpression.cs @@ -70,11 +70,5 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax AddChild(trueExpression, TrueRole); AddChild(falseExpression, FalseRole); } - - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) - { - ConditionalExpression o = other as ConditionalExpression; - return o != null && this.Condition.DoMatch(o.Condition, match) && this.TrueExpression.DoMatch(o.TrueExpression, match) && this.FalseExpression.DoMatch(o.FalseExpression, match); - } } } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DeclarationExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DeclarationExpression.cs index ff325e296..c24382f8d 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DeclarationExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DeclarationExpression.cs @@ -16,8 +16,6 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -using ICSharpCode.Decompiler.CSharp.Syntax.PatternMatching; - namespace ICSharpCode.Decompiler.CSharp.Syntax { /// @@ -35,12 +33,5 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax get { return GetChildByRole(Roles.VariableDesignationRole); } set { SetChildByRole(Roles.VariableDesignationRole, value); } } - - protected internal override bool DoMatch(AstNode other, Match match) - { - return other is DeclarationExpression o - && Type.DoMatch(o.Type, match) - && Designation.DoMatch(o.Designation, match); - } } } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DefaultValueExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DefaultValueExpression.cs index f11463b39..6e310505e 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DefaultValueExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DefaultValueExpression.cs @@ -60,12 +60,6 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax { AddChild(type, Roles.Type); } - - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) - { - DefaultValueExpression o = other as DefaultValueExpression; - return o != null && this.Type.DoMatch(o.Type, match); - } } } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DirectionExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DirectionExpression.cs index 5fd051285..9f07667ee 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DirectionExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DirectionExpression.cs @@ -78,11 +78,5 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax this.FieldDirection = direction; AddChild(expression, Roles.Expression); } - - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) - { - DirectionExpression o = other as DirectionExpression; - return o != null && this.FieldDirection == o.FieldDirection && this.Expression.DoMatch(o.Expression, match); - } } } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ErrorExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ErrorExpression.cs index beece741b..956ec76b7 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ErrorExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ErrorExpression.cs @@ -42,11 +42,6 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax } } - public string Error { - get; - private set; - } - public ErrorExpression() { } @@ -55,12 +50,6 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax { AddChild(new Comment(error, CommentType.MultiLine), Roles.Comment); } - - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) - { - var o = other as ErrorExpression; - return o != null; - } } } diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/IdentifierExpression.cs b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/IdentifierExpression.cs index 7a78d9739..e6da3ddd6 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/IdentifierExpression.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/Expressions/IdentifierExpression.cs @@ -64,11 +64,5 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax public AstNodeCollection TypeArguments { get { return GetChildrenByRole(Roles.TypeArgument); } } - - protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) - { - IdentifierExpression o = other as IdentifierExpression; - return o != null && MatchString(this.Identifier, o.Identifier) && this.TypeArguments.DoMatch(o.TypeArguments, match); - } } }