[svn] r7351: nemerle/trunk/ncc/parsing/MainParser.n
nemerle/trunk/ncc/typing/Typer.n vs-plugin/trunk/Nemer...
IT
svnadmin at nemerle.org
Mon Jan 29 03:45:55 CET 2007
Log:
1. Removed warnings.
2. Working on TExpr location.
Author: IT
Date: Mon Jan 29 03:45:49 2007
New Revision: 7351
Modified:
nemerle/trunk/ncc/parsing/MainParser.n
nemerle/trunk/ncc/typing/Typer.n
vs-plugin/trunk/Nemerle.Compiler.Utils/CodeDomHelper.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ExprFinder.n
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/DefineCollection.n
Modified: nemerle/trunk/ncc/parsing/MainParser.n
==============================================================================
--- nemerle/trunk/ncc/parsing/MainParser.n (original)
+++ nemerle/trunk/ncc/parsing/MainParser.n Mon Jan 29 03:45:49 2007
@@ -2245,7 +2245,10 @@
parse_expr (stop)
}
else
- PExpr.TypeEnforcement (loc, parse_expr (stop), ty);
+ {
+ def pe = parse_expr (stop);
+ PExpr.TypeEnforcement (ty.Location.Combine(pe.Location), pe, ty);
+ }
def define =
match (id) {
Modified: nemerle/trunk/ncc/typing/Typer.n
==============================================================================
--- nemerle/trunk/ncc/typing/Typer.n (original)
+++ nemerle/trunk/ncc/typing/Typer.n Mon Jan 29 03:45:49 2007
@@ -2672,7 +2672,13 @@
{
match (TypeNameFull (expr, expected)) {
| [] => TExpr.Error ()
- | overloads => MakeOverloadedNode (overloads, expected)
+ | overloads =>
+ def texpr = MakeOverloadedNode (overloads, expected);
+ match (texpr) {
+ | Error => ()
+ | _ => texpr.loc = expr.Location;
+ }
+ texpr;
}
}
#endregion
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/CodeDomHelper.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/CodeDomHelper.n (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/CodeDomHelper.n Mon Jan 29 03:45:49 2007
@@ -78,7 +78,7 @@
CodeLinePragma(loc.File,loc.Line)
}
- public MapFilterByType[T1,T2](this collection: IEnumerable[T1]) : list[T2]
+ public MapFilterByType[T1,T2](this collection: SCG.IEnumerable[T1]) : list[T2]
{
def res = SCG.List();
foreach(e is T2 in collection)
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 Mon Jan 29 03:45:49 2007
@@ -22,10 +22,10 @@
mutable _texprLocation : Location;
mutable _stop : bool;
- //PExprName : string
- //{
- // get { if (_pexprObject == null) null else _pexprObject.ToString() }
- //}
+ PExprName : string
+ {
+ get { if (_pexprObject == null) null else _pexprObject.ToString() }
+ }
PFinder(info : ExprWalkInfo) : void
{
@@ -35,7 +35,7 @@
Print(info.Node, loc, info.Nodes.Length);
- when (IsIn(loc))
+ if (IsIn(loc))
{
when (_pexprObject == null || _pexprLocation.Contains(loc))
{
@@ -52,6 +52,10 @@
| _ => ()
}
}
+ else if (_line < loc.Line || _line == loc.Line && _col < loc.Column)
+ info.Stop()
+ else when (_line > loc.EndLine || _line == loc.EndLine && _col > loc.EndColumn)
+ info.Skip();
}
}
@@ -82,14 +86,13 @@
{
| DefValIn (name, _, _) when IsIn(name.NameLocation) => name;
| TypeConversion(_, ty, _, tloc) when IsIn(tloc) => ty : object;
+ | StaticRef(from, mem, _) => // { from : MType.Class; mem : IMember; type_parms : list [TyVar]; }
+
+ if (mem.Name == PExprName || mem.MemberKind == MemberKinds.Constructor && from.tycon.Name == PExprName)
+ mem
+ else
+ from : object
- //| StaticRef(from, mem, _) => // { from : MType.Class; mem : IMember; type_parms : list [TyVar]; }
-//
- //if (mem.MemberKind != MemberKinds.Constructor && from.tycon.Name == PExprName)
- //from
- //else
- //mem : object
-//
//| TypeConversion(_, tt, _) => // { mutable expr : TExpr; target_type : TyVar; kind : ConversionKind; }
//
//if (tt.IsFixed)
@@ -165,7 +168,7 @@
Print(info.Node, loc, info.Nodes.Length);
- when (IsIn(loc))
+ if (IsIn(loc))
{
when (_texprObject == null || loc == _pexprLocation || _texprLocation.Contains(loc))
{
@@ -174,10 +177,20 @@
_texprLocation = loc;
_texprObject = info.Node;
- when (loc == _pexprLocation)
+ def isInExpr(expr)
+ {
+ | TExpr.DefValIn(name, _, _) => IsIn(name.NameLocation);
+ | _ => false;
+ }
+
+ when (loc == _pexprLocation || isInExpr(info.Node))
info.Stop();
}
}
+ else if (_line < loc.Line || _line == loc.Line && _col < loc.Column)
+ info.Stop()
+ else when (_line > loc.EndLine || _line == loc.EndLine && _col > loc.EndColumn)
+ info.Skip();
| _ => ()
}
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/DefineCollection.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/DefineCollection.n (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/DefineCollection.n Mon Jan 29 03:45:49 2007
@@ -7,6 +7,7 @@
using Nemerle.Utility;
using Typed = Nemerle.Compiler.Typedtree;
+using SCG = System.Collections.Generic;
using SR = System.Reflection;
namespace Nemerle.Completion2
@@ -65,7 +66,7 @@
}
}
- public GetEnumerator () : Nemerle.Collections.IEnumerator[string]
+ public GetEnumerator () : SCG.IEnumerator[string]
{
Nemerle.Collections.ListEnumerator (_defines)
}
More information about the svn
mailing list