diff --git a/tconfpy.py b/tconfpy.py index bd1408b..49a6a6a 100755 --- a/tconfpy.py +++ b/tconfpy.py @@ -6,7 +6,7 @@ # Program Information PROGNAME = "tconfpy" -RCSID = "$Id: tconfpy.py,v 1.131 2004/03/24 08:47:55 tundra Exp $" +RCSID = "$Id: tconfpy.py,v 1.132 2004/03/24 09:33:44 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -225,14 +225,15 @@ # Messages -Messages["eBADCOND"] = FILENUM + "Bad '%s' Directive. %s" -Messages["eBADSYNTAX"] = FILENUM + "Syntax Error. Statement Not In Known Form" -Messages["eCONFOPEN"] = FILENUM + "Cannot Open The File '%s'" -Messages["eENDIFEXTRA"] = FILENUM + "'" + ENDIF + "' Without Matching Condition" -Messages["eENDIFMISS"] = FILENUM + "Missing %d" + " '%s' " % ENDIF + " Statement(s)" -Messages["eEQUIVEXTRA"] = FILENUM + "Only a single '%s' Or '%s' Operator Permitted" % (EQUIV, NOTEQUIV) -Messages["eIFEXTRATXT"] = FILENUM + "Extra Text On Line. '%s' Only Accepts Variable References As Arguments" -Messages["eVARUNDEF"] = FILENUM + "Attempt To Reference Undefined Variable '%s'" +Messages["eBADCOND"] = FILENUM + "Bad '%s' Directive. %s" +Messages["eBADSYNTAX"] = FILENUM + "Syntax Error. Statement Not In Known Form" +Messages["eCONFOPEN"] = FILENUM + "Cannot Open The File '%s'" +Messages["eDESCRIPTBAD"] = "API Error: Bad Descriptor Passed For Variable '%s'" +Messages["eENDIFEXTRA"] = FILENUM + "'" + ENDIF + "' Without Matching Condition" +Messages["eENDIFMISS"] = FILENUM + "Missing %d" + " '%s' " % ENDIF + " Statement(s)" +Messages["eEQUIVEXTRA"] = FILENUM + "Only a single '%s' Or '%s' Operator Permitted" % (EQUIV, NOTEQUIV) +Messages["eIFEXTRATXT"] = FILENUM + "Extra Text On Line. '%s' Only Accepts Variable References As Arguments" +Messages["eVARUNDEF"] = FILENUM + "Attempt To Reference Undefined Variable '%s'" ########### @@ -264,12 +265,6 @@ #----------------------------------------------------------# -# Object Base Class Definitions # -#----------------------------------------------------------# - - - -#----------------------------------------------------------# # Utility Function Definitions # #----------------------------------------------------------# @@ -362,7 +357,18 @@ # Add any passed symbols to the SymbolTable for sym in InitialSymTbl: - SymTable[sym] = InitialSymTbl[sym] + + des = InitialSymTbl[sym] + + # Make sure a valid descriptor was passed for each variable + + if isinstance(des, VarDescriptor): + SymTable[sym] = des + + # Invalid descriptor passed + else: + ErrorMsg("eDESCRIPTBAD", sym) + return (SymTable, ErrMsgs, WarnMsgs, DebugMsgs, LiteralLines) # Parse the file