Skip to content

Commit

Permalink
Add ref modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
siegfriedpammer committed Mar 4, 2018
1 parent 19e8408 commit 6362244
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ICSharpCode.Decompiler/CSharp/Syntax/CSharpModifierToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ protected internal override bool DoMatch(AstNode other, PatternMatching.Match ma
Modifiers.Unsafe,
Modifiers.Abstract, Modifiers.Virtual, Modifiers.Sealed, Modifiers.Static, Modifiers.Override,
Modifiers.Readonly, Modifiers.Volatile,
Modifiers.Ref,
Modifiers.Extern, Modifiers.Partial, Modifiers.Const,
Modifiers.Async,
Modifiers.Any
Expand Down Expand Up @@ -118,6 +119,8 @@ public static string GetModifierName(Modifiers modifier)
return "unsafe";
case Modifiers.Async:
return "async";
case Modifiers.Ref:
return "ref";
case Modifiers.Any:
// even though it's used for pattern matching only, 'any' needs to be in this list to be usable in the AST
return "any";
Expand Down Expand Up @@ -163,6 +166,8 @@ public static int GetModifierLength(Modifiers modifier)
return "unsafe".Length;
case Modifiers.Async:
return "async".Length;
case Modifiers.Ref:
return "ref".Length;
case Modifiers.Any:
// even though it's used for pattern matching only, 'any' needs to be in this list to be usable in the AST
return "any".Length;
Expand Down Expand Up @@ -208,6 +213,8 @@ public static Modifiers GetModifierValue(string modifier)
return Modifiers.Unsafe;
case "async":
return Modifiers.Async;
case "ref":
return Modifiers.Ref;
case "any":
// even though it's used for pattern matching only, 'any' needs to be in this list to be usable in the AST
return Modifiers.Any;
Expand Down
1 change: 1 addition & 0 deletions ICSharpCode.Decompiler/CSharp/Syntax/Modifiers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public enum Modifiers
Volatile = 0x4000,
Unsafe = 0x8000,
Async = 0x10000,
Ref = 0x20000,

VisibilityMask = Private | Internal | Protected | Public,

Expand Down

0 comments on commit 6362244

Please sign in to comment.