Better handling of progs.dat and line numbers.

Not enough testing :P
This commit is contained in:
Bill Currie 2012-11-15 14:53:09 +09:00
parent d5c831b6da
commit fb82a96cc7

View file

@ -86,7 +86,7 @@ current_file = []
source_list = []
qcc_list = []
defines = {}
progs_dat = "progs.dat"
progs_dat = None
progs_src = "progs.src"
compile_this_file = 1
keep_newlines = 1
@ -252,6 +252,7 @@ def process_source (source_file):
arg1 = string.strip (g[1])
margs = string.strip (g[4])
#pprint ((directive, arg1, margs))
comment_out = True
if directive == 'pragma':
if condition[-1]:
parse_pragma (arg1, margs)
@ -286,8 +287,11 @@ def process_source (source_file):
del condition[-1]
else:
if condition[-1]:
print "ignoring " + l
comment_out = False
if comment_out:
output.append ('//' + l)
else:
output.append (l)
else:
if (includelist):
fname = parse_filename (l)
@ -341,7 +345,9 @@ while i < len (sys.argv):
del sys.argv[i]
continue
i = i + 1
progs_dat = None
do_preprogs_src ()
if progs_dat == None:
progs_dat = source_list[0]
source_list = source_list[1:]
for s in source_list: