Libraryless. Click here for Pure Java version (3290L/20K).
1 | sS extractAndPrintJavaParseError(S src, Throwable e) {
|
2 | new StringBuilder buf; |
3 | print_tee(buf); |
4 | S msg = takeFirstLines(2, innerMessage(e)); |
5 | print_tee(buf, msg); |
6 | int line = parseIntOpt(regexpFirstGroupIC("line (\\d+)", msg));
|
7 | print_tee(buf); |
8 | if (line != 0) {
|
9 | L<S> lines = lines(src); |
10 | for (int i = max(1, line-5); i <= min(l(lines), line+5); i++) |
11 | print_tee(buf, (i == line ? "* " : " ") + "LINE " + i + ": " + lines.get(i-1)); |
12 | } |
13 | print_tee(buf); |
14 | ret str(buf); |
15 | } |
Began life as a copy of #1015768
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1015769 |
| Snippet name: | extractAndPrintJavaParseError |
| Eternal ID of this version: | #1015769/7 |
| Text MD5: | ca7aabd81880661e8e4651ddfa7a6eea |
| Transpilation MD5: | e64204e1f8f565048a327f23f5145850 |
| Author: | stefan |
| Category: | javax / code analysis |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2021-06-22 07:13:05 |
| Source code size: | 505 bytes / 15 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 713 / 856 |
| Version history: | 6 change(s) |
| Referenced in: | [show references] |