[Nice-commit] Nice/src/bossa/syntax GlobalTypeScope.java,1.5,1.6 TypeScope.java,1.38,1.39
Brought to you by:
bonniot
|
From: <ar...@us...> - 2003-03-22 12:43:24
|
Update of /cvsroot/nice/Nice/src/bossa/syntax
In directory sc8-pr-cvs1:/tmp/cvs-serv23264/F:/nice/src/bossa/syntax
Modified Files:
GlobalTypeScope.java TypeScope.java
Log Message:
In the globaltypscope are names which are case insensitve equal not allowed.
Index: GlobalTypeScope.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/GlobalTypeScope.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** GlobalTypeScope.java 11 Nov 2002 20:14:51 -0000 1.5
--- GlobalTypeScope.java 22 Mar 2003 12:43:21 -0000 1.6
***************
*** 13,16 ****
--- 13,17 ----
package bossa.syntax;
+ import java.util.*;
import bossa.util.*;
import mlsub.typing.TypeSymbol;
***************
*** 29,32 ****
--- 30,43 ----
{
super(null);
+ set = new HashSet();
+ }
+
+ void addMapping(String name, TypeSymbol s)
+ throws DuplicateName
+ {
+ super.addMapping(name, s);
+
+ if (!set.add(name.toLowerCase()))
+ throw new DuplicateName(name);
}
***************
*** 86,88 ****
--- 97,100 ----
public Module module;
+ private Set set;
}
Index: TypeScope.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/TypeScope.java,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** TypeScope.java 29 Oct 2002 09:13:27 -0000 1.38
--- TypeScope.java 22 Mar 2003 12:43:21 -0000 1.39
***************
*** 56,60 ****
class DuplicateName extends Exception
{
! DuplicateName(String name, TypeSymbol old, TypeSymbol nou)
{
super(name + " is already declared");
--- 56,60 ----
class DuplicateName extends Exception
{
! DuplicateName(String name)
{
super(name + " is already declared");
***************
*** 67,71 ****
Object old = map.put(name,s);
if (old != null)
! throw new DuplicateName(name, (TypeSymbol) old, s);
}
--- 67,71 ----
Object old = map.put(name,s);
if (old != null)
! throw new DuplicateName(name);
}
|