[svn]
r6587: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.n
IT
svnadmin at nemerle.org
Sun Aug 27 23:18:29 CEST 2006
Log:
Fixed quick tips for ctors and static fields.
Author: IT
Date: Sun Aug 27 23:18:26 2006
New Revision: 6587
Modified:
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.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 Aug 27 23:18:26 2006
@@ -127,13 +127,17 @@
}
}
+#define PRINT_AST1
+
private FindLocatedExpr(
root : PExpr,
line : int,
col : int)
: (Location * object)
{
- //Trace.WriteLine($"\nStart looking at: $line:$col.");
+#if PRINT_AST
+ Trace.WriteLine($"\nStart looking at: $line:$col.");
+#endif
def Print[T](ex : T) : void
{
@@ -153,17 +157,20 @@
def Print2(ex)
{
+#if PRINT_AST
mutable s = "";
for (mutable i = 0; i < counter; i++)
s += " ";
- //Trace.WriteLine(s + $"$(ex.GetType().FullName) $(ex.loc.Line):"
- // "$(ex.loc.Column):$(ex.loc.EndLine):$(ex.loc.EndColumn) cur:"
- // "$(curLocation.Line):$(curLocation.Column):$(curLocation.EndLine):"
- // "$(curLocation.EndColumn).");
- //Trace.WriteLine(s + ex.ToString().Replace("\n", "\n" + s));
- //Trace.WriteLine("");
+ Trace.WriteLine(s + $"$(ex.GetType().FullName) $(ex.loc.Line):"
+ "$(ex.loc.Column):$(ex.loc.EndLine):$(ex.loc.EndColumn) cur:"
+ "$(curLocation.Line):$(curLocation.Column):$(curLocation.EndLine):"
+ "$(curLocation.EndColumn).");
+ Trace.WriteLine(s + ex.ToString().Replace("\n", "\n" + s));
+ Trace.WriteLine("");
+#endif
+
ignore(ex);
}
@@ -324,7 +331,9 @@
locationToFind : Location)
: (Location * object)
{
- //Trace.WriteLine($"\nStart looking at: $line:$col, $locationToFind.");
+#if PRINT_AST
+ Trace.WriteLine($"\nStart looking at: $line:$col, $locationToFind.");
+#endif
def Print[T](ex : T) : void
{
@@ -344,14 +353,17 @@
def Print2(ex : Located)
{
+#if PRINT_AST
mutable s = "";
for (mutable i = 0; i < counter; i++)
s += " ";
- //Trace.WriteLine(s + $"$(ex.GetType().FullName) $(ex.loc.Line):$(ex.loc.Column):$(ex.loc.EndLine):$(ex.loc.EndColumn) cur:$(curLocation.Line):$(curLocation.Column):$(curLocation.EndLine):$(curLocation.EndColumn).");
- //Trace.WriteLine(s + ex.ToString().Replace("\n", "\n" + s));
- //Trace.WriteLine("");
+ Trace.WriteLine(s + $"$(ex.GetType().FullName) $(ex.loc.Line):$(ex.loc.Column):$(ex.loc.EndLine):$(ex.loc.EndColumn) cur:$(curLocation.Line):$(curLocation.Column):$(curLocation.EndLine):$(curLocation.EndColumn).");
+ Trace.WriteLine(s + ex.ToString().Replace("\n", "\n" + s));
+ Trace.WriteLine("");
+#endif
+
ignore(ex);
}
@@ -493,11 +505,17 @@
| FieldMember (obj, mem : IMember) // { obj : TExpr; fld : IField; }
| PropertyMember(obj, mem : IMember) => // { obj : TExpr; prop : IProperty; }
+ def isThis = obj is TExpr.This;
+
+ unless (isThis)
Go(obj);
when (!stop && IsIn(expression.Location))
checkObject(expression.Location, mem);
+ when (isThis)
+ Go(obj);
+
| Block (_, e) // { jump_out : LocalValue; body : TExpr; }
| Throw (e) // { exn : TExpr; }
| TypeConversion(e, _, _) // { mutable expr : TExpr; target_type : TyVar; kind : ConversionKind; }
@@ -542,6 +560,13 @@
unless (body == null)
Go(body);
+ | Sequence(TExpr.Call(TExpr.Base as b, _, _), e2) as seq =>
+
+ when (seq.Location != b.Location)
+ Go(b);
+
+ Go(e2);
+
| Assign (e1, e2) // { target : TExpr; source : TExpr; }
| TryFinally(e1, e2) // { body : TExpr; handler : TExpr; }
| Sequence (e1, e2) => // { mutable e1 : TExpr; mutable e2 : TExpr; }
More information about the svn
mailing list