|
|
@ -26,32 +26,19 @@ |
|
|
|
|
|
|
|
|
|
|
|
#nullable enable |
|
|
|
#nullable enable |
|
|
|
|
|
|
|
|
|
|
|
using System; |
|
|
|
using ICSharpCode.Decompiler.TypeSystem; |
|
|
|
|
|
|
|
|
|
|
|
namespace ICSharpCode.Decompiler.CSharp.Syntax |
|
|
|
namespace ICSharpCode.Decompiler.CSharp.Syntax |
|
|
|
{ |
|
|
|
{ |
|
|
|
public enum ParameterModifier |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
None, |
|
|
|
|
|
|
|
Ref, |
|
|
|
|
|
|
|
Out, |
|
|
|
|
|
|
|
Params, |
|
|
|
|
|
|
|
In, |
|
|
|
|
|
|
|
Scoped |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class ParameterDeclaration : AstNode |
|
|
|
public class ParameterDeclaration : AstNode |
|
|
|
{ |
|
|
|
{ |
|
|
|
public static readonly Role<AttributeSection> AttributeRole = EntityDeclaration.AttributeRole; |
|
|
|
public static readonly Role<AttributeSection> AttributeRole = EntityDeclaration.AttributeRole; |
|
|
|
public static readonly TokenRole ThisModifierRole = new TokenRole("this"); |
|
|
|
public static readonly TokenRole ThisModifierRole = new TokenRole("this"); |
|
|
|
public static readonly TokenRole ScopedRefRole = new TokenRole("scoped"); |
|
|
|
public static readonly TokenRole ScopedRefRole = new TokenRole("scoped"); |
|
|
|
[Obsolete("Renamed to ScopedRefRole")] |
|
|
|
|
|
|
|
public static readonly TokenRole RefScopedRole = ScopedRefRole; |
|
|
|
|
|
|
|
public static readonly TokenRole RefModifierRole = new TokenRole("ref"); |
|
|
|
public static readonly TokenRole RefModifierRole = new TokenRole("ref"); |
|
|
|
|
|
|
|
public static readonly TokenRole ReadonlyModifierRole = ComposedType.ReadonlyRole; |
|
|
|
public static readonly TokenRole OutModifierRole = new TokenRole("out"); |
|
|
|
public static readonly TokenRole OutModifierRole = new TokenRole("out"); |
|
|
|
public static readonly TokenRole InModifierRole = new TokenRole("in"); |
|
|
|
public static readonly TokenRole InModifierRole = new TokenRole("in"); |
|
|
|
[Obsolete("C# 11 preview: \"ref scoped\" no longer supported")] |
|
|
|
|
|
|
|
public static readonly TokenRole ValueScopedRole = new TokenRole("scoped"); |
|
|
|
|
|
|
|
public static readonly TokenRole ParamsModifierRole = new TokenRole("params"); |
|
|
|
public static readonly TokenRole ParamsModifierRole = new TokenRole("params"); |
|
|
|
|
|
|
|
|
|
|
|
#region PatternPlaceholder
|
|
|
|
#region PatternPlaceholder
|
|
|
@ -107,6 +94,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool hasThisModifier; |
|
|
|
bool hasThisModifier; |
|
|
|
|
|
|
|
bool isParams; |
|
|
|
bool isScopedRef; |
|
|
|
bool isScopedRef; |
|
|
|
|
|
|
|
|
|
|
|
public CSharpTokenNode ThisKeyword { |
|
|
|
public CSharpTokenNode ThisKeyword { |
|
|
@ -127,16 +115,15 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public bool IsScopedRef { |
|
|
|
public bool IsParams { |
|
|
|
get { return isScopedRef; } |
|
|
|
get { return isParams; } |
|
|
|
set { |
|
|
|
set { |
|
|
|
ThrowIfFrozen(); |
|
|
|
ThrowIfFrozen(); |
|
|
|
isScopedRef = value; |
|
|
|
isParams = value; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Obsolete("Renamed to IsScopedRef")] |
|
|
|
public bool IsScopedRef { |
|
|
|
public bool IsRefScoped { |
|
|
|
|
|
|
|
get { return isScopedRef; } |
|
|
|
get { return isScopedRef; } |
|
|
|
set { |
|
|
|
set { |
|
|
|
ThrowIfFrozen(); |
|
|
|
ThrowIfFrozen(); |
|
|
@ -144,15 +131,9 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Obsolete("C# 11 preview: \"ref scoped\" no longer supported")] |
|
|
|
ReferenceKind parameterModifier; |
|
|
|
public bool IsValueScoped { |
|
|
|
|
|
|
|
get { return false; } |
|
|
|
|
|
|
|
set { } |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ParameterModifier parameterModifier; |
|
|
|
public ReferenceKind ParameterModifier { |
|
|
|
|
|
|
|
|
|
|
|
public ParameterModifier ParameterModifier { |
|
|
|
|
|
|
|
get { return parameterModifier; } |
|
|
|
get { return parameterModifier; } |
|
|
|
set { |
|
|
|
set { |
|
|
|
ThrowIfFrozen(); |
|
|
|
ThrowIfFrozen(); |
|
|
@ -240,19 +221,6 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax |
|
|
|
{ |
|
|
|
{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ParameterDeclaration(AstType type, string name, ParameterModifier modifier = ParameterModifier.None) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Type = type; |
|
|
|
|
|
|
|
Name = name; |
|
|
|
|
|
|
|
ParameterModifier = modifier; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ParameterDeclaration(string name, ParameterModifier modifier = ParameterModifier.None) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Name = name; |
|
|
|
|
|
|
|
ParameterModifier = modifier; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public new ParameterDeclaration Clone() |
|
|
|
public new ParameterDeclaration Clone() |
|
|
|
{ |
|
|
|
{ |
|
|
|
return (ParameterDeclaration)base.Clone(); |
|
|
|
return (ParameterDeclaration)base.Clone(); |
|
|
|