LEFT | RIGHT |
(no file at all) | |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 import sys | 2 import sys |
3 import re | 3 import re |
4 import os | 4 import os |
5 | 5 |
6 | 6 |
7 full_paths = {} | 7 full_paths = {} |
8 incs = {} | 8 incs = {} |
9 inc_re = re.compile ('^#include "([^"]+)"') | 9 inc_re = re.compile ('^#include "([^"]+)"') |
10 def parse_file (fn): | 10 def parse_file (fn): |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 def has_include (f, name): | 25 def has_include (f, name): |
26 try: | 26 try: |
27 return name in [b for (a,b) in incs[f]] | 27 return name in [b for (a,b) in incs[f]] |
28 except KeyError: | 28 except KeyError: |
29 return False | 29 return False |
30 | 30 |
31 for a in sys.argv: | 31 for a in sys.argv: |
32 parse_file (a) | 32 parse_file (a) |
33 | 33 |
34 print '-*-compilation-*-' | 34 print('-*-compilation-*-') |
35 for (f, lst) in incs.items (): | 35 for (f, lst) in list(incs.items ()): |
36 for (n, inc) in lst: | 36 for (n, inc) in lst: |
37 for (n2, inc2) in lst: | 37 for (n2, inc2) in lst: |
38 if has_include (inc2, inc): | 38 if has_include (inc2, inc): |
39 print "%s:%d: already have %s from %s" % (full_paths[f], n, | 39 print("%s:%d: already have %s from %s" % (full_paths[f], n, |
40 inc, inc2) | 40 inc, inc2)) |
41 break | 41 break |
42 | 42 |
43 ········ | 43 ········ |
44 ···· | 44 ···· |
LEFT | RIGHT |