mirror of
https://github.com/Z3Prover/z3
synced 2025-06-06 14:13:23 +00:00
tabs
This commit is contained in:
parent
05b29df2cb
commit
25af97fb8b
2 changed files with 62 additions and 62 deletions
|
@ -17,55 +17,55 @@ def fix_hdr(file):
|
|||
line = ins.readline()
|
||||
found = False
|
||||
while line:
|
||||
m = doubleu.search(line)
|
||||
if m:
|
||||
ous.write("#")
|
||||
ous.write(m.group(1))
|
||||
ous.write(" ")
|
||||
ous.write(m.group(2))
|
||||
ous.write("_H_\n")
|
||||
line = ins.readline()
|
||||
found = True
|
||||
continue
|
||||
m = ifndef.search(line)
|
||||
if m:
|
||||
print(m.group(1))
|
||||
ous.write("#ifndef ")
|
||||
ous.write(m.group(1))
|
||||
ous.write("_H_\n")
|
||||
line = ins.readline()
|
||||
found = True
|
||||
continue
|
||||
m = defn.search(line)
|
||||
if m:
|
||||
ous.write("#define ")
|
||||
ous.write(m.group(1))
|
||||
ous.write("_H_\n")
|
||||
line = ins.readline()
|
||||
found = True
|
||||
continue
|
||||
m = endif.search(line)
|
||||
if m:
|
||||
ous.write("#endif /* ")
|
||||
ous.write(m.group(1))
|
||||
ous.write("_H_ */\n")
|
||||
line = ins.readline()
|
||||
found = True
|
||||
continue
|
||||
ous.write(line)
|
||||
line = ins.readline()
|
||||
m = doubleu.search(line)
|
||||
if m:
|
||||
ous.write("#")
|
||||
ous.write(m.group(1))
|
||||
ous.write(" ")
|
||||
ous.write(m.group(2))
|
||||
ous.write("_H_\n")
|
||||
line = ins.readline()
|
||||
found = True
|
||||
continue
|
||||
m = ifndef.search(line)
|
||||
if m:
|
||||
print(m.group(1))
|
||||
ous.write("#ifndef ")
|
||||
ous.write(m.group(1))
|
||||
ous.write("_H_\n")
|
||||
line = ins.readline()
|
||||
found = True
|
||||
continue
|
||||
m = defn.search(line)
|
||||
if m:
|
||||
ous.write("#define ")
|
||||
ous.write(m.group(1))
|
||||
ous.write("_H_\n")
|
||||
line = ins.readline()
|
||||
found = True
|
||||
continue
|
||||
m = endif.search(line)
|
||||
if m:
|
||||
ous.write("#endif /* ")
|
||||
ous.write(m.group(1))
|
||||
ous.write("_H_ */\n")
|
||||
line = ins.readline()
|
||||
found = True
|
||||
continue
|
||||
ous.write(line)
|
||||
line = ins.readline()
|
||||
ins.close()
|
||||
ous.close()
|
||||
if found:
|
||||
os.system("move %s %s" % (tmp, file))
|
||||
os.system("move %s %s" % (tmp, file))
|
||||
else:
|
||||
os.system("del %s" % tmp)
|
||||
|
||||
os.system("del %s" % tmp)
|
||||
|
||||
def fixup(dir):
|
||||
for root, dirs, files in os.walk(dir):
|
||||
for f in files:
|
||||
if f.endswith('.h'):
|
||||
path = "%s\\%s" % (root, f)
|
||||
fix_hdr(path)
|
||||
for f in files:
|
||||
if f.endswith('.h'):
|
||||
path = "%s\\%s" % (root, f)
|
||||
fix_hdr(path)
|
||||
|
||||
fixup('src')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue