diff --git a/twander.py b/twander.py index 8c27f54..2758d21 100755 --- a/twander.py +++ b/twander.py @@ -4,7 +4,7 @@ # For Updates See: http://www.tundraware.com/Software/twander PROGNAME = "twander" -RCSID = "$Id: twander.py,v 2.18 2002/12/15 23:19:23 tundra Exp $" +RCSID = "$Id: twander.py,v 2.19 2002/12/17 00:58:23 tundra Exp $" VERSION = RCSID.split()[2] @@ -510,6 +510,18 @@ # field. If it is a 3rd field, it is not # a variable definition, but a command definition. # + # If the LHS is one of the Program Function Names + # used in key binding, the statement is understood + # to be a key rebinding, not a user variable definition. + # + # Finally, the LHS cannot be one of the program + # builtin variables - it is an error, for example, + # to have something like: + # + # DIR = string + # + # because "DIR" is a builtin variable name. + # elif ((dummy[0].count(ASSIGN) + dummy[1].count(ASSIGN)) > 0) and (fields[0][0] != ASSIGN): @@ -517,8 +529,13 @@ name = line[:assign].strip() val=line[assign+1:].strip() - # Warn on variable redefinitions - if UI.SymTable.has_key(name): + # Error out on variable redefinitions of either + # existing user-defined variables or built-ins + + if UI.SymTable.has_key(name) or \ + UI.BuiltIns.has_key('[' + name + ']') or \ + UI.BuiltIns.has_key('[' + name): + ErrMsg(eREDEFVAR % (name, num, line)) sys.exit(1)