Added code to handle comments in include files.
1 parent 4a99867 commit 1a5c2669346d6107954bb7c43a6840f25cb85950
@tundra tundra authored on 22 Jan 2010
Showing 1 changed file
View
8
tren.py
 
# Program Information
 
PROGNAME = "tren.py"
RCSID = "$Id: tren.py,v 1.105 2010/01/23 00:38:55 tundra Exp $"
RCSID = "$Id: tren.py,v 1.106 2010/01/23 01:00:00 tundra Exp $"
VERSION = RCSID.split()[2]
 
# Copyright Information
 
# Literals
#####
 
ALL = "All" # Rename target is whole filename
COMMENT = "#" # Comment character in include files
EXT = "Ext" # Rename target is extension
EXTDELIM = "." # Extension delimeter
INCL = "-I" # Include file command line option
NAM = "Nam" # Rename target is name
if NUMINCLUDES >= MAXINCLUDES:
ErrorMsg(eTOOMANYINC)
sys.exit(1)
 
# Replace insert option on the command line with that file's contents
# Replace insert option on the command line with that file's contents.
# Handle comments within lines.
 
try:
n = []
f = open(file)
for l in f.readlines():
l = l.split(COMMENT)[0]
n += l.split()
f.close()
 
OPTIONS = lhs + n + rhs