-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Currently, the Env classes defined in files envVal and envRef have a void checkDuplicates method that can be used to throw an exception if a list of VAR tokens has any duplicates. This is used by the parser in LetDecls, Formals, Fields, Methods, and Statics constructor :init hooks to catch duplicate identifiers.
I propose to modify this method to return the Set<String> instance constructed in the method body instead of returning nothing (void). This will not break existing code (where the return value is simply ignored), but it can be useful in the OBJ language to check if the sets of Static, Field, and Method identifiers contain any of the 'reserved' identifiers self, super, etc. In the current OBJ version, these identifier sets are checked only for duplicates.