projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
2002-11-14 Martin Baulig <martin@ximian.com>
[mono.git]
/
mcs
/
mcs
/
modifiers.cs
diff --git
a/mcs/mcs/modifiers.cs
b/mcs/mcs/modifiers.cs
index 4c114035836d4ef1d00331535917317055ffec70..a5cf6f62c036aa69c09f8546ef6b5cbd5fdc0024 100755
(executable)
--- a/
mcs/mcs/modifiers.cs
+++ b/
mcs/mcs/modifiers.cs
@@
-66,12
+66,11
@@
namespace Mono.CSharp {
return s;
}
return s;
}
- public static TypeAttributes TypeAttr (int mod_flags,
TypeContainer caller
)
+ public static TypeAttributes TypeAttr (int mod_flags,
bool is_toplevel
)
{
TypeAttributes t = 0;
{
TypeAttributes t = 0;
- bool top_level = caller.IsTopLevel;
- if (
top_
level){
+ if (
is_top
level){
if ((mod_flags & PUBLIC) != 0)
t |= TypeAttributes.Public;
if ((mod_flags & PRIVATE) != 0)
if ((mod_flags & PUBLIC) != 0)
t |= TypeAttributes.Public;
if ((mod_flags & PRIVATE) != 0)
@@
-94,6
+93,13
@@
namespace Mono.CSharp {
if ((mod_flags & ABSTRACT) != 0)
t |= TypeAttributes.Abstract;
if ((mod_flags & ABSTRACT) != 0)
t |= TypeAttributes.Abstract;
+ return t;
+ }
+
+ public static TypeAttributes TypeAttr (int mod_flags, TypeContainer caller)
+ {
+ TypeAttributes t = TypeAttr (mod_flags, caller.IsTopLevel);
+
// If we do not have static constructors, static methods
// can be invoked without initializing the type.
if (!caller.HaveStaticConstructor)
// If we do not have static constructors, static methods
// can be invoked without initializing the type.
if (!caller.HaveStaticConstructor)
@@
-221,11
+227,15
@@
namespace Mono.CSharp {
if ((i & invalid_flags) == 0)
continue;
if ((i & invalid_flags) == 0)
continue;
- Report.Error (106, l, "the modifier `" + Name (i) +
- "' is not valid for this item");
+ Error_InvalidModifier (l, Name (i));
}
return allowed & mod;
}
}
return allowed & mod;
}
+
+ public static void Error_InvalidModifier (Location l, string name)
+ {
+ Report.Error (106, l, "the modifier " + name + " is not valid for this item");
+ }
}
}
}
}