[svn] r7256: nemerle/trunk/ncc: hierarchy/ClassMembers.n
parsing/Utility.n
VladD2
svnadmin at nemerle.org
Fri Jan 12 12:41:14 CET 2007
Log:
Add Message.FatalError2() which no throw in IsIntelliSenseMode.
Use it method instead Message.FatalError() in MemberBuilder (and in it inheritors).
Author: VladD2
Date: Fri Jan 12 12:41:13 2007
New Revision: 7256
Modified:
nemerle/trunk/ncc/hierarchy/ClassMembers.n
nemerle/trunk/ncc/parsing/Utility.n
Modified: nemerle/trunk/ncc/hierarchy/ClassMembers.n
==============================================================================
--- nemerle/trunk/ncc/hierarchy/ClassMembers.n (original)
+++ nemerle/trunk/ncc/hierarchy/ClassMembers.n Fri Jan 12 12:41:13 2007
@@ -317,7 +317,7 @@
protected check_for_invalid_attr (attr : NemerleAttributes, attr_name : string) : void
{
when (attributes %&& attr)
- Message.FatalError (loc, "invalid attribute `" + attr_name +
+ Message.FatalError2 (loc, "invalid attribute `" + attr_name +
"' specified for " + ToString ())
}
@@ -334,7 +334,7 @@
// check the access attributes for consistency
match (TypeBuilder.CheckAccessAttributes (attributes)) {
- | Some (msg) => Message.FatalError (loc, $"$msg for $title: $(this)")
+ | Some (msg) => Message.FatalError2 (loc, $"$msg for $title: $(this)")
| _ => ()
}
@@ -346,41 +346,41 @@
// make sure 'virtual', 'new' and 'override' never appear at once
when (mem_is_override && mem_is_new)
- Message.FatalError (loc, $"both `override' and `new' attributes specified"
+ Message.FatalError2 (loc, $"both `override' and `new' attributes specified"
" for $title: $(this)");
// only allow 'override' methods/properties/events to be 'sealed'
when (mem_is_sealed && !mem_is_override)
- Message.FatalError (loc, $"only `override' $title are allowed to be `sealed': $(this)");
+ Message.FatalError2 (loc, $"only `override' $title are allowed to be `sealed': $(this)");
// do not allow new virtual methods/properties/events in sealed clases
when (declaring_type.IsSealed && mem_is_virtual && !mem_is_override && !declaring_type.IsDelegate)
- Message.FatalError (loc, Name +
+ Message.FatalError2 (loc, Name +
" is a new virtual member in a sealed class " +
declaring_type.FullName);
// do not allow private abstract methods
when (mem_is_abstract && IsPrivate)
- Message.FatalError (loc, "abstract " + title_plural + " are not allowed to be private: " +
+ Message.FatalError2 (loc, "abstract " + title_plural + " are not allowed to be private: " +
ToString ());
// do not allow private 'virtual' or 'override' methods/properties/events
when (mem_is_virtual && IsPrivate)
- Message.FatalError (loc, "virtual " + title_plural + " are not allowed to be private: " +
+ Message.FatalError2 (loc, "virtual " + title_plural + " are not allowed to be private: " +
ToString ());
when (mem_is_override && IsPrivate)
- Message.FatalError (loc, $"override $title_plural are not allowed to be private: $(this)");
+ Message.FatalError2 (loc, $"override $title_plural are not allowed to be private: $(this)");
// do not allow to mix abstract with the 'override' modifier
when (mem_is_abstract && mem_is_override)
- Message.FatalError (loc, $"abstract $title_plural are not allowed to have the "
+ Message.FatalError2 (loc, $"abstract $title_plural are not allowed to have the "
"'override' modifier: $(this)");
// static methods/properties cannot be abstract, virtual or override
when ((mem_is_abstract || mem_is_virtual || mem_is_override) && IsStatic)
- Message.FatalError (loc, $"static $title_plural are not allowed to have the "
+ Message.FatalError2 (loc, $"static $title_plural are not allowed to have the "
"`virtual' or `override' modifier: $(this)");
// do not allow protected and protected internal methods in structures
@@ -388,7 +388,7 @@
{
def msg = if (IsInternal) "protected internal" else "protected";
- Message.FatalError (loc, $"$title_plural defined in a struct are not"
+ Message.FatalError2 (loc, $"$title_plural defined in a struct are not"
" allowed to be $msg: $(this)")
}
}
@@ -573,7 +573,7 @@
public override CheckAttributes () : void
{
when (declaring_type.IsInterface)
- Message.FatalError (loc, "fields cannot be defined inside interface");
+ Message.FatalError2 (loc, "fields cannot be defined inside interface");
check_for_invalid_attr (NemerleAttributes.Extern, "extern");
check_for_invalid_attr (NemerleAttributes.Abstract, "abstract");
@@ -585,20 +585,20 @@
// check the access attributes for consistency
match (TypeBuilder.CheckAccessAttributes (attributes)) {
- | Some (msg) => Message.FatalError (loc, $"$msg for $(this)")
+ | Some (msg) => Message.FatalError2 (loc, $"$msg for $(this)")
| _ => ()
}
// check for non-mutable / volatile consistency
when (!IsMutable && IsVolatile)
- Message.FatalError (loc, $"only mutable fields are allowed to be volatile in $(this)");
+ Message.FatalError2 (loc, $"only mutable fields are allowed to be volatile in $(this)");
// do not allow protected and protected internal methods in structures
when (declaring_type.IsStruct && IsProtected)
{
def msg = if (IsInternal) "protected internal" else "protected";
- Message.FatalError (loc, "fields defined in a struct are not allowed to be " +
+ Message.FatalError2 (loc, "fields defined in a struct are not allowed to be " +
msg + "in " + ToString ())
}
}
@@ -734,7 +734,7 @@
{
// make sure no static indexers get defined
when (IsStatic && IsIndexer)
- Message.FatalError (loc, "indexer properties are not allowed to be static in " +
+ Message.FatalError2 (loc, "indexer properties are not allowed to be static in " +
ToString ());
// most of the checks are common with the methods and events:
@@ -1353,7 +1353,7 @@
def bodyless = attributes %&& (NemerleAttributes.Abstract | NemerleAttributes.Extern);
when (HasAbstractBody && !bodyless)
- Message.FatalError (loc, "missing body of a non-abstract and non-extern method in " +
+ Message.FatalError2 (loc, "missing body of a non-abstract and non-extern method in " +
ToString ());
when (attributes %&& NemerleAttributes.Extern && !HasAbstractBody)
Modified: nemerle/trunk/ncc/parsing/Utility.n
==============================================================================
--- nemerle/trunk/ncc/parsing/Utility.n (original)
+++ nemerle/trunk/ncc/parsing/Utility.n Fri Jan 12 12:41:13 2007
@@ -270,6 +270,13 @@
throw Recovery ()
}
+ public FatalError2 (loc : Location, m : string) : void
+ {
+ Message.Error (loc, m);
+ unless (Manager.IsIntelliSenseMode)
+ throw Recovery ()
+ }
+
public FatalError['a] (m : string) : 'a
{
Message.FatalError (Location.Default, m)
More information about the svn
mailing list