[svn]
r6594: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.n
IT
svnadmin at nemerle.org
Tue Aug 29 14:05:29 CEST 2006
Log:
Working on quick tips.
Author: IT
Date: Tue Aug 29 14:05:27 2006
New Revision: 6594
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 Tue Aug 29 14:05:27 2006
@@ -127,7 +127,7 @@
}
}
-#define PRINT_AST1
+#define PRINT_AST
private FindLocatedExpr(
root : PExpr,
@@ -163,10 +163,11 @@
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.GetType().FullName) $(ex.loc.Line):$(ex.loc.Column):"
+ "$(ex.loc.EndLine):$(ex.loc.EndColumn) "
+ "cur:$(curLocation.Line):$(curLocation.Column):"
+ "$(curLocation.EndLine):$(curLocation.EndColumn) "
+ "$line:$col.");
Trace.WriteLine(s + ex.ToString().Replace("\n", "\n" + s));
Trace.WriteLine("");
#endif
@@ -284,6 +285,25 @@
checkLocated(expression)
+ | Indexer(obj, args) => // { obj : PExpr; args : list [PExpr]; }
+
+ Go(obj);
+ args.Iter(Go);
+
+ | DefFunctions(funs) => // { funs : list [Function_decl]; }
+
+ foreach (f when !stop in funs)
+ {
+ if (IsIn(f.header.Location))
+ {
+ foreach (p in f.header.parms)
+ Go(p.ty);
+ Go(f.header.ret_type);
+ }
+ else
+ Go(f.body);
+ }
+
| Void // `void' used only in types
| As // { pat : PExpr; name : Splicable; }
| Is // { pat : PExpr; ty : PExpr; }
@@ -291,7 +311,6 @@
| Match // { expr : PExpr; cases : list [MatchCase]; }
| GenericSpecifier // { func : PExpr; generic_parms : list [PExpr]; }
| DefMutable // { name : PExpr; val : PExpr; }
- | DefFunctions // { funs : list [Function_decl]; }
| Lambda // { decl : Function_decl; }
| Throw // { exn : PExpr; }
| Try // { body : PExpr; cases : list [TryCase]; }
@@ -300,7 +319,6 @@
| Base
| Array // { rank : PExpr; args : PExpr; }
| EmptyArray // { sizes : list [PExpr]; }
- | Indexer // { obj : PExpr; args : list [PExpr]; }
| ParmByRef // { parm : PExpr; }
| ParmOut // { parm : PExpr; }
| Quoted // { body : SyntaxElement; }
@@ -359,7 +377,11 @@
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.GetType().FullName) $(ex.loc.Line):$(ex.loc.Column):"
+ "$(ex.loc.EndLine):$(ex.loc.EndColumn) "
+ "cur:$(curLocation.Line):$(curLocation.Column):"
+ "$(curLocation.EndLine):$(curLocation.EndColumn) "
+ "$line:$col.");
Trace.WriteLine(s + ex.ToString().Replace("\n", "\n" + s));
Trace.WriteLine("");
#endif
@@ -554,8 +576,8 @@
| DefValIn(name, val, body) => // { name : LocalValue; val : TExpr; mutable body : TExpr; }
- Go(val);
checkLocated(name);
+ Go(val);
unless (body == null)
Go(body);
@@ -641,6 +663,7 @@
unless (stop)
{
+ unless (pexpr is TExpr.Literal)
Go(pexpr);
foreach ((_localValue, aexpr) in assigns)
More information about the svn
mailing list