mirror of https://github.com/icsharpcode/ILSpy.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.0 KiB
49 lines
1.0 KiB
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) |
|
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) |
|
|
|
using ICSharpCode.NRefactory.VB.Dom; |
|
|
|
namespace ICSharpCode.NRefactory.VB.Parser |
|
{ |
|
internal class ParamModifierList |
|
{ |
|
ParameterModifiers cur; |
|
VBParser parser; |
|
|
|
public ParameterModifiers Modifier { |
|
get { |
|
return cur; |
|
} |
|
} |
|
|
|
public ParamModifierList(VBParser parser) |
|
{ |
|
this.parser = parser; |
|
cur = ParameterModifiers.None; |
|
} |
|
|
|
public bool isNone { get { return cur == ParameterModifiers.None; } } |
|
|
|
public void Add(ParameterModifiers m) |
|
{ |
|
if ((cur & m) == 0) { |
|
cur |= m; |
|
} else { |
|
parser.Error("param modifier " + m + " already defined"); |
|
} |
|
} |
|
|
|
public void Add(ParamModifierList m) |
|
{ |
|
Add(m.cur); |
|
} |
|
|
|
public void Check() |
|
{ |
|
if((cur & ParameterModifiers.In) != 0 && |
|
(cur & ParameterModifiers.Ref) != 0) { |
|
parser.Error("ByRef and ByVal are not allowed at the same time."); |
|
} |
|
} |
|
} |
|
}
|
|
|