[svn] r6889: vs-plugin/trunk: ConsoleTest/Program.cs
Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/...
IT
svnadmin at nemerle.org
Tue Nov 14 21:56:08 CET 2006
Log:
Unit test for using Nemerle.Imperative.
Author: IT
Date: Tue Nov 14 21:56:02 2006
New Revision: 6889
Modified:
vs-plugin/trunk/ConsoleTest/Program.cs
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Checker.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ExprFinder.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Content/Class1.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Tests.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Utils.n
Modified: vs-plugin/trunk/ConsoleTest/Program.cs
==============================================================================
--- vs-plugin/trunk/ConsoleTest/Program.cs (original)
+++ vs-plugin/trunk/ConsoleTest/Program.cs Tue Nov 14 21:56:02 2006
@@ -12,6 +12,7 @@
Test1 test = new Test1();
test.Init();
+ test.QuickTip_Imperative();
test.QuickTip_StackOverflow();
test.Check_partial_region();
test.Check_region_location();
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Checker.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Checker.n (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Checker.n Tue Nov 14 21:56:02 2006
@@ -274,7 +274,6 @@
{
match (info.Node)
{
- //| PExpr.MacroCall => info.Skip();
| PExpr.DefFunctions(funs) => // { funs : list [Function_decl]; }
funs.Iter(f => AddRegion(
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ExprFinder.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ExprFinder.n (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ExprFinder.n Tue Nov 14 21:56:02 2006
@@ -293,6 +293,8 @@
Print(obj : object, loc : Location, level : int) : void
{
+ _ = obj.ToString();
+
#if PRINT_AST
mutable s = "";
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 Tue Nov 14 21:56:02 2006
@@ -65,10 +65,10 @@
static this()
{
- def topKeywords = ["using", "class", "struct",
- "variant", "namespace", "enum"];
- _topKeywords = StrsToCompletionElems(topKeywords,
- GlyphType.Snippet :> int, "snippet or top level keyword");
+ _topKeywords = StrsToCompletionElems(
+ ["using", "class", "struct", "variant", "namespace", "enum"],
+ GlyphType.Snippet :> int,
+ "snippet or top level keyword");
}
static _topKeywords : array[CompletionElem];
@@ -121,7 +121,6 @@
{
| Using as us => GetUsingQuickTip(us, fileIndex, line, col)
| Type as tp => GetTypeQuickTip (tp, fileIndex, line, col, _engine);
- | None => throw System.Exception()
| _ => null
}
}
@@ -134,7 +133,6 @@
match (decl)
{
| Type as tp => GetTypeGoto(tp, fileIndex, line, col).ToArray();
- | None => throw System.Exception()
| _ => null
}
}
@@ -147,7 +145,6 @@
match (decl)
{
| Type as ty => FindUsages(ty, fileIndex, line, col).ToArray();
- | None => throw System.Exception() //VladD2: Êàòåãîðè÷åñêè íå íàäî òàê äåëàòü!
| _ => null
}
}
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Content/Class1.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Content/Class1.n (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Content/Class1.n Tue Nov 14 21:56:02 2006
@@ -170,6 +170,18 @@
}
}
+class Class4
+{
+ Foo() : void
+ {
+ while (2 > 1)
+ {
+ break;
+ _ = "".ToString/*Class4*/();
+ }
+ }
+}
+
module ClassExtension
{
Boo() : void
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Tests.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Tests.n (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Tests.n Tue Nov 14 21:56:02 2006
@@ -494,5 +494,18 @@
WriteLine(result.Text);
Assert.AreEqual (result.Text.Split('\n')[0], "internal sealed variant TestVariant2.CValue");
}
+
+ [Test]
+ public QuickTip_Imperative() : void
+ {
+ def file = FilePath1;
+ def (line, col) = ReadLocation(file, "Class4");
+
+ def result = _project.GetQuickTipInfo(file, line, col);
+
+ Assert.IsNotNull(result, "result is null");
+ WriteLine(result.Text);
+ Assert.AreEqual (result.Text.Split('\n')[0], "internal sealed variant TestVariant2.CValue");
+ }
}
}
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 Tue Nov 14 21:56:02 2006
@@ -27,14 +27,12 @@
public GetParsedBody(this /*[NotNull]*/ method : MethodBuilder) : PExpr
{
- //VladD2: Ìíå ýòî ñîâñåì íå íðàâèòñÿ. Íå íàäî çàìçûâàòü îøèáêè. Åñëè îíè åñòü èõ íóæíî èñïðàâëÿòü.
- //  êðàéíåì ñëó÷àå íàäî ïèñòü ñîîáùåíèÿ â Trace.
- try { method.BodyParsed } catch { _ => null }
+ method.BodyParsed
}
public GetTypedBody(this /*[NotNull]*/ method : MethodBuilder) : TExpr
{
- try { method.BodyTyped } catch { _ => null }
+ method.BodyTyped
}
public IsNullOrEmpty(this value : string) : bool
More information about the svn
mailing list