diff --git a/twander.py b/twander.py index 9bdd035..3de97b2 100755 --- a/twander.py +++ b/twander.py @@ -6,7 +6,7 @@ # Program Information PROGNAME = "twander" -RCSID = "$Id: twander.py,v 3.114 2003/02/28 23:18:55 tundra Exp $" +RCSID = "$Id: twander.py,v 3.115 2003/02/28 23:45:55 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -639,8 +639,9 @@ # Warnings wBADCFGLINE = "Ignoring Line %s.\nBogus Configuration Entry:\n\n%s" +wBADIF = "Ignoring Line %s.\nBogus Beginning-Of-Block Statement: \n\n%s" wBADDEBUG = "Ignoring Bogus Debug Level! - %s Is Not In Integer Or Hex Format." -wBADENDIF = "No Conditional Block To End!\nIgnoring Line %s:\n\n%s" +wBADENDIF = "Ignoring Line %s!\nBogus End-Of-Block Statement:\n\n%s" wBADENVVBL = "Ignoring Line %s.\nEnvironment Variable %s Not Set:\n\n%s" wBADEXE = "Could Not Execute Command:\n\n%s" wBADRHS = "Ignoring Line %s.\nOption Assignment Has Bad Righthand Side:\n\n%s" @@ -649,6 +650,7 @@ wCONFOPEN = "Cannot Open Configuration File:\n%s" wDIRSCREDEF = "Ignoring Line %s.\nDirectory Shortcut Defined More Than Once:\n\n%s" wDUPKEY = "Ignoring Line %s.\nFound Duplicate Command Key '%s':\n\n%s" +wEXTRAENDIF = "Ignoring Line %s!\nNo Conditional Block To End:\n\n%s" wLINKBACK = "%s Points Back To Own Directory" wNOCMDS = "Running With No Commands Defined!" wNOREBIND = "Ignoring Line %s.\nCannot Rebind This Keyboard Or Mouse Button Combination:\n\n%s" @@ -1066,7 +1068,7 @@ # Existence checks must be in the form: .IF [VAR] if len(fields) != 2: - WrnMsg(wBADCOND) + WrnMsg(wBADIF % (num, line)) return # Presume 2nd field is in the form: [VAR] @@ -1092,16 +1094,22 @@ elif fields[0] == CONDENDIF: - # The conditional stack must always have 1 value left in - # it after all conditional processing. If it does not, - # it means there are more ENDIFs than IFs. + # The end-of-block statement must be on a line by itself - if len(ConditionalStack) > 1: - ConditionalStack.pop() - - else: + if len(fields) != 1: WrnMsg(wBADENDIF % (num,line)) + # The conditional stack must always have 1 value left in + # it *after* all conditional processing. If it does not, + # it means there are more ENDIFs than IFs. + + elif len(ConditionalStack) == 1: + WrnMsg(wEXTRAENDIF % (num,line)) + + else: + ConditionalStack.pop() + + print ConditionalStack ### # Variable Definitions And Special Assignments