-
Notifications
You must be signed in to change notification settings - Fork 258
Commit 7d6622e
expander.py: trace line numbers back to the original source file
Using the "#line" directives, it's possible to allow compilers to
report line numbers from the original source file. At least GCC
and Clang support this. It's useful for tracing the compilation
error locations back to the original file. Example:
#include <iostream>
#include <atcoder/lazysegtree>
int main() {
lazy_segtree<S, op, e, F, mapping, composition, id> seg(arr);
}
== The current default behaviour: ==
$ ./expander.py example.cpp
$ g++ combined.cpp
combined.cpp: In function ‘int main()’:
combined.cpp:263:3: error: ‘lazy_segtree’ was not declared in this
scope; did you mean ‘atcoder::lazy_segtree’?
== With the new '--origname' option: ==
$ ./expander.py --origname=example.cpp example.cpp
$ g++ combined.cpp
example.cpp: In function ‘int main()’:
example.cpp:4:3: error: ‘lazy_segtree’ was not declared in this
scope; did you mean ‘atcoder::lazy_segtree’?1 parent d8ca7f2 commit 7d6622e
1 file changed
+8
-2
lines changedLines changed: 8 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
63 | 63 |
| |
64 | 64 |
| |
65 | 65 |
| |
66 | - | ||
66 | + | ||
67 | 67 |
| |
68 | 68 |
| |
69 | + | ||
69 | 70 |
| |
71 | + | ||
70 | 72 |
| |
71 | 73 |
| |
72 | 74 |
| |
73 | 75 |
| |
76 | + | ||
77 | + | ||
74 | 78 |
| |
75 | 79 |
| |
76 | 80 |
| |
| |||
88 | 92 |
| |
89 | 93 |
| |
90 | 94 |
| |
95 | + | ||
96 | + | ||
91 | 97 |
| |
92 | 98 |
| |
93 | 99 |
| |
| |||
99 | 105 |
| |
100 | 106 |
| |
101 | 107 |
| |
102 | - | ||
108 | + | ||
103 | 109 |
| |
104 | 110 |
| |
105 | 111 |
| |
|
0 commit comments