diff --git a/tconfpy.py b/tconfpy.py index b8d82a7..55d2bec 100755 --- a/tconfpy.py +++ b/tconfpy.py @@ -6,7 +6,7 @@ # Program Information PROGNAME = "tconfpy" -RCSID = "$Id: tconfpy.py,v 1.107 2004/03/12 09:10:02 tundra Exp $" +RCSID = "$Id: tconfpy.py,v 1.108 2004/03/12 09:22:19 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -331,7 +331,7 @@ global CondStack, MsgList, SymTable - orig = line + orig = line # May need copy of original for debug output line = ConditionLine(line) ########## @@ -341,8 +341,11 @@ # Only attempt on non-blank lines if line: - # Process .endif statements before checking state since - # these potentially change the state. + ##### + # .endif Processing - Must be done before state check + # because .endif can change state + ##### + if line.startswith(ENDIF): @@ -358,25 +361,29 @@ ErrorMsg(eENDIFEXTRA % (cfgfile, linenum)) CondStack.append(False) # Inhibit further parsing - # If we are in a False conditional block, this line - # is ignored. + ##### + # Check State Of Parser + ##### if not CondStack[-1]: if DEBUG: DebugMsg(dLINEIGNORE %(cfgfile, linenum, orig)) return - # Process .include statements + ##### + # .include Processing + ##### if line.startswith(INCLUDE): - ParseFile(line.split(INCLUDE)[1].strip()) - return - # Substitute references to reserved symbols + ##### + # Replace Explicit References To Reserved Symbols + ##### - for ref in Reserved.keys(): - line = line.replace("%s%s%s" % (DELIML, ref, DELIMR), Reserved[ref]) + else: + for ref in Reserved.keys(): + line = line.replace("%s%s%s" % (DELIML, ref, DELIMR), Reserved[ref]) ##########