Nice/src/bossa/syntax VarScope.java,1.23,1.24
Daniel Bonniot <[email protected]>
| Newsgroups | gmane.comp.lang.nice.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/nice/Nice/src/bossa/syntax
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7643/src/bossa/syntax
Modified Files:
VarScope.java
Log Message:
Local var scopes can have at most one binding per name. Drop HashMultiTable.
Index: VarScope.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/VarScope.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** VarScope.java 6 Mar 2005 12:55:57 -0000 1.23
--- VarScope.java 6 Mar 2005 13:59:30 -0000 1.24
***************
*** 64,68 ****
{
this.outer = outer;
! this.defs = new HashMultiTable();
}
--- 64,68 ----
{
this.outer = outer;
! this.defs = new HashMap();
}
***************
*** 80,84 ****
void removeSymbol(/*VarSymbol*/Symbol sym)
{
! defs.remove(sym.name, sym);
}
--- 80,84 ----
void removeSymbol(/*VarSymbol*/Symbol sym)
{
! defs.remove(sym.name);
}
***************
*** 92,104 ****
public List lookup(LocatedString i)
{
! List res = defs.getAll(i);
!
! if(res!=null)
! return res;
!
if(outer!=null)
return outer.lookup(i);
! return new LinkedList();
}
--- 92,108 ----
public List lookup(LocatedString i)
{
! Object res = defs.get(i);
!
! if (res != null)
! {
! LinkedList l = new LinkedList();
! l.add(res);
! return l;
! }
!
if(outer!=null)
return outer.lookup(i);
! return Collections.EMPTY_LIST;
}
***************
*** 114,124 ****
* Debugging
****************************************************************/
!
public String toString()
{
! return defs.elementCount()+";;\n"+outer;
}
!
private VarScope outer;
! private HashMultiTable defs;
}
--- 118,128 ----
* Debugging
****************************************************************/
!
public String toString()
{
! return defs.size()+";;\n"+outer;
}
!
private VarScope outer;
! private HashMap defs;
}
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click