Skip to content

Commit 0541e53

Browse files
WIP
1 parent 31ebba1 commit 0541e53

File tree

9 files changed

+4
-56
lines changed

9 files changed

+4
-56
lines changed

ICSharpCode.Decompiler.Generators/DecompilerSyntaxTreeGenerator.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,10 @@ public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)
244244
{
245245
builder.Append($"\r\n\t\t\t&& (this.{member} == {typeName}.Any || this.{member} == o.{member})");
246246
}
247+
else if (typeName == "String")
248+
{
249+
builder.Append($"\r\n\t\t\t&& MatchString(this.{member}, o.{member})");
250+
}
247251
else
248252
{
249253
builder.Append($"\r\n\t\t\t&& this.{member} == o.{member}");

ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CastExpression.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,6 @@ public CastExpression(AstType castToType, Expression expression)
5858
AddChild(castToType, Roles.Type);
5959
AddChild(expression, Roles.Expression);
6060
}
61-
62-
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
63-
{
64-
CastExpression o = other as CastExpression;
65-
return o != null && this.Type.DoMatch(o.Type, match) && this.Expression.DoMatch(o.Expression, match);
66-
}
6761
}
6862
}
6963

ICSharpCode.Decompiler/CSharp/Syntax/Expressions/CheckedExpression.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,5 @@ public CheckedExpression(Expression expression)
5959
{
6060
AddChild(expression, Roles.Expression);
6161
}
62-
63-
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
64-
{
65-
CheckedExpression o = other as CheckedExpression;
66-
return o != null && this.Expression.DoMatch(o.Expression, match);
67-
}
6862
}
6963
}

ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ConditionalExpression.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,5 @@ public ConditionalExpression(Expression condition, Expression trueExpression, Ex
7070
AddChild(trueExpression, TrueRole);
7171
AddChild(falseExpression, FalseRole);
7272
}
73-
74-
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
75-
{
76-
ConditionalExpression o = other as ConditionalExpression;
77-
return o != null && this.Condition.DoMatch(o.Condition, match) && this.TrueExpression.DoMatch(o.TrueExpression, match) && this.FalseExpression.DoMatch(o.FalseExpression, match);
78-
}
7973
}
8074
}

ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DeclarationExpression.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1717
// DEALINGS IN THE SOFTWARE.
1818

19-
using ICSharpCode.Decompiler.CSharp.Syntax.PatternMatching;
20-
2119
namespace ICSharpCode.Decompiler.CSharp.Syntax
2220
{
2321
/// <summary>
@@ -35,12 +33,5 @@ public VariableDesignation Designation {
3533
get { return GetChildByRole(Roles.VariableDesignationRole); }
3634
set { SetChildByRole(Roles.VariableDesignationRole, value); }
3735
}
38-
39-
protected internal override bool DoMatch(AstNode other, Match match)
40-
{
41-
return other is DeclarationExpression o
42-
&& Type.DoMatch(o.Type, match)
43-
&& Designation.DoMatch(o.Designation, match);
44-
}
4536
}
4637
}

ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DefaultValueExpression.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,6 @@ public DefaultValueExpression(AstType type)
6060
{
6161
AddChild(type, Roles.Type);
6262
}
63-
64-
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
65-
{
66-
DefaultValueExpression o = other as DefaultValueExpression;
67-
return o != null && this.Type.DoMatch(o.Type, match);
68-
}
6963
}
7064
}
7165

ICSharpCode.Decompiler/CSharp/Syntax/Expressions/DirectionExpression.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,5 @@ public DirectionExpression(FieldDirection direction, Expression expression)
7878
this.FieldDirection = direction;
7979
AddChild(expression, Roles.Expression);
8080
}
81-
82-
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
83-
{
84-
DirectionExpression o = other as DirectionExpression;
85-
return o != null && this.FieldDirection == o.FieldDirection && this.Expression.DoMatch(o.Expression, match);
86-
}
8781
}
8882
}

ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ErrorExpression.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ public override TextLocation EndLocation {
4242
}
4343
}
4444

45-
public string Error {
46-
get;
47-
private set;
48-
}
49-
5045
public ErrorExpression()
5146
{
5247
}
@@ -55,12 +50,6 @@ public ErrorExpression(string error)
5550
{
5651
AddChild(new Comment(error, CommentType.MultiLine), Roles.Comment);
5752
}
58-
59-
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
60-
{
61-
var o = other as ErrorExpression;
62-
return o != null;
63-
}
6453
}
6554
}
6655

ICSharpCode.Decompiler/CSharp/Syntax/Expressions/IdentifierExpression.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,5 @@ public Identifier IdentifierToken {
6464
public AstNodeCollection<AstType> TypeArguments {
6565
get { return GetChildrenByRole(Roles.TypeArgument); }
6666
}
67-
68-
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
69-
{
70-
IdentifierExpression o = other as IdentifierExpression;
71-
return o != null && MatchString(this.Identifier, o.Identifier) && this.TypeArguments.DoMatch(o.TypeArguments, match);
72-
}
7367
}
7468
}

0 commit comments

Comments
 (0)