[svn] r6481: nemerle/trunk/ncc: parsing/PreParser.n passes.n
VladD2
svnadmin at nemerle.org
Fri Aug 4 22:59:58 CEST 2006
Log:
Change using parsing notification.
Author: VladD2
Date: Fri Aug 4 22:59:54 2006
New Revision: 6481
Modified:
nemerle/trunk/ncc/parsing/PreParser.n
nemerle/trunk/ncc/passes.n
Modified: nemerle/trunk/ncc/parsing/PreParser.n
==============================================================================
--- nemerle/trunk/ncc/parsing/PreParser.n (original)
+++ nemerle/trunk/ncc/parsing/PreParser.n Fri Aug 4 22:59:54 2006
@@ -338,7 +338,7 @@
def current_begin = current_stream.Count;
mutable currentNsEnv = Env; // GlobalEnv of current namespace
- def get_qualified_identifier () : list [string] * Location
+ def get_qualified_identifier () : list [string] * list [Location]
{
def tok1 = get_token ();
match (tok1)
@@ -348,25 +348,25 @@
match (tok2)
{
| Token.Operator (".") =>
- def (ident, loc) = get_qualified_identifier ();
+ def (ident, locs) = get_qualified_identifier ();
match (ident)
{
- | [] => ([x], tok1.Location + tok2.Location)
- | _ => (x :: ident, tok1.Location + loc)
+ | [] => ([x], [tok1.Location, tok2.Location])
+ | _ => (x :: ident, tok1.Location :: tok2.Location :: locs)
}
- | t => push_back (t); ([x], tok1.Location)
+ | t => push_back (t); ([x], [tok1.Location, tok2.Location])
}
| t =>
Message.Error (t.Location, $"expected qualified identifier, got token $t");
push_back (t);
- ([], Location.Default)
+ ([], [])
}
}
def parse_using_directive (tok)
{
finish_current (current_begin);
- def (id, idLoc) = get_qualified_identifier ();
+ def (id, idLocs) = get_qualified_identifier ();
match (get_token ()) {
| Token.Semicolon as st =>
@@ -378,10 +378,10 @@
current_stream.Add (using_tok);
lexer.Manager.OnAfterUsingDirectiveParse(
- loc + st.Location, id, idLoc, currentNsEnv, Env);
+ loc + st.Location, id, idLocs, currentNsEnv, Env);
| Token.Operator ("=") =>
- def (id', idLoc') = get_qualified_identifier ();
+ def (id', idLocs') = get_qualified_identifier ();
def st = get_token ();
match (st) {
@@ -398,12 +398,12 @@
current_stream.Add (using_tok);
lexer.Manager.OnAfterUsingDirectiveParse(tok.Location + st.Location,
- id', idLoc', currentNsEnv, Env);
+ id', idLocs', currentNsEnv, Env);
| x =>
Message.Error (x.Location, "expecting `;' or `='");
lexer.Manager.OnAfterUsingDirectiveParse(tok.Location + lexer.Location,
- id, idLoc, currentNsEnv, Env);
+ id, idLocs, currentNsEnv, Env);
}
finish_current (current_begin);
@@ -421,7 +421,7 @@
def prevNsEnv = currentNsEnv;
currentNsEnv = Env;
- def (id, idLoc) = get_qualified_identifier ();
+ def (id, idLocs) = get_qualified_identifier ();
match (get_token ()) {
| Token.BeginBrace as br =>
def loc = tok.Location + br.Location;
@@ -446,7 +446,7 @@
}
lexer.Manager.OnAfterNamespaceParse (loc + nsBodyLoc,
- id, idLoc, oldEnv, Env, nsBodyLoc);
+ id, idLocs, oldEnv, Env, nsBodyLoc);
Env = oldEnv;
lexer.Keywords = Env.Keywords;
Modified: nemerle/trunk/ncc/passes.n
==============================================================================
--- nemerle/trunk/ncc/passes.n (original)
+++ nemerle/trunk/ncc/passes.n Fri Aug 4 22:59:54 2006
@@ -124,18 +124,18 @@
* location : Location - location of qualified identifier.
*/
protected mutable _afterUsingDirectiveParse
- : Location * list [string] * Location * GlobalEnv * GlobalEnv -> void;
+ : Location * list [string] * list [Location] * GlobalEnv * GlobalEnv -> void;
internal OnAfterUsingDirectiveParse(
location : Location,
name : list [string],
- nameLocation : Location,
+ nameLocations : list [Location],
beforeEnv : GlobalEnv,
afterEnv : GlobalEnv
) : void
{
when (_afterUsingDirectiveParse != null)
- _afterUsingDirectiveParse (location, name, nameLocation, beforeEnv, afterEnv);
+ _afterUsingDirectiveParse (location, name, nameLocations, beforeEnv, afterEnv);
}
protected mutable _beforeNamespaceParse : void -> void;
@@ -147,19 +147,19 @@
}
protected mutable _afterNamespaceParse
- : Location * list [string] * Location * GlobalEnv * GlobalEnv * Location -> void;
+ : Location * list [string] * list [Location] * GlobalEnv * GlobalEnv * Location -> void;
internal OnAfterNamespaceParse (
location : Location,
name : list [string],
- nameLocation : Location,
+ nameLocations : list [Location],
outsideEnv : GlobalEnv,
insideEnv : GlobalEnv,
bodyLocation : Location
) : void
{
when (_afterNamespaceParse != null)
- _afterNamespaceParse (location, name, nameLocation, outsideEnv,
+ _afterNamespaceParse (location, name, nameLocations, outsideEnv,
insideEnv, bodyLocation);
}
More information about the svn
mailing list