[svn] r6870: vs-plugin/trunk/Nemerle.Compiler.Utils:
Nemerle.Completion2/CodeModel/Project.Type.n Nemerle....
VladD2
svnadmin at nemerle.org
Sun Nov 12 01:33:15 CET 2006
Log:
Prevent compile body of abstract methods.
Author: VladD2
Date: Sun Nov 12 01:33:11 2006
New Revision: 6870
Modified:
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/XmlDocReader.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine-main.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Utils.n
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n
==============================================================================
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.n (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.n Sun Nov 12 01:33:11 2006
@@ -149,14 +149,11 @@
foreach (cm when cm.Location.FileIndex == fileIndex in Errors)
yield cm;
- foreach (method when method.Env != null in GetAllMetodsDefinedInFile(fileIndex))
- {
- try
+ def isIgnore(m) { m.Env == null || m.Attributes %&& NemerleAttributes.Abstract }
+
+ foreach (method when !isIgnore(method) in GetAllMetodsDefinedInFile(fileIndex))
{
method.EnsureCompiled();
- }
- catch { _ => () }
-
foreach (cm in method.BodyMessages)
yield cm;
}
@@ -267,7 +264,7 @@
def isProcessed(m)
{
- !(m.Attributes %&& NemerleAttributes.SpecialName)
+ !(m.Attributes %&& (NemerleAttributes.SpecialName | NemerleAttributes.Abstract))
&& m.Location.FileIndex == fileIndex
}
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/XmlDocReader.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/XmlDocReader.n (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/XmlDocReader.n Sun Nov 12 01:33:11 2006
@@ -178,7 +178,6 @@
}
ret(null);
-
}
| _ => ()
}
@@ -186,7 +185,6 @@
}
null
-
}
}
}
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine-main.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine-main.n (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine-main.n Sun Nov 12 01:33:11 2006
@@ -209,20 +209,9 @@
def loc = method.BodyLocation;
def bodyCode =
if (loc == Location.Default)
- {
"{}"
- }
- else
- {
- try
- {
- def filePath = loc.File;
- def source = ProjectSources.GetSource(filePath);
-
- source.GetRegion(loc);
- }
- catch { e => reportError(e, "Try get"); "{}" } // return empty body!
- }
+ else try { ProjectSources.GetSource(loc.File).GetRegion(loc); }
+ catch { e => reportError(e, "Try get"); "{}" }; // return empty body!
try
{
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Utils.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Utils.n (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Utils.n Sun Nov 12 01:33:11 2006
@@ -17,6 +17,8 @@
{
public GetParsedBody(this /*[NotNull]*/ method : MethodBuilder) : PExpr
{
+ //VladD2: Ìíå ýòî ñîâñåì íå íðàâèòñÿ. Íå íàäî çàìçûâàòü îøèáêè. Åñëè îíè åñòü èõ íóæíî èñïðàâëÿòü.
+ //  êðàéíåì ñëó÷àå íàäî ïèñòü ñîîáùåíèÿ â Trace.
try { method.BodyParsed } catch { _ => null }
}
More information about the svn
mailing list