Libraryless. Compilation Failed (3761L/25K).
1 | !752 |
2 | |
3 | !include #1004828 // Java Analysis |
4 | |
5 | p { |
6 | loadConceptsFrom("#1004820"); |
7 | JavaTok j = conceptOfType(JavaTok.class); |
8 | L<Token> tokens = sortedByField(findBackRefs(j, Token.class), "index"); |
9 | new StringBuilder buf; |
10 | int i = 0; |
11 | for (Token t : tokens) { |
12 | buf.append(htmlencode(substring(j.text, i, t.charIndex))); |
13 | S col = odd(t.index/2) |
14 | //? "#b8d1f3" : "#dae5f4"; |
15 | ? "#CC0000" : "#0000CC"; // Coder Colors! |
16 | buf.append(span(b(href(str(t.index), htmlencode(t.token()))), "style", "color: " + col)); |
17 | i = t.charIndex + l(t.token()); |
18 | } |
19 | buf.append(htmlencode(substring(j.text, i))); |
20 | |
21 | S html = hhtml(pre(buf)); |
22 | JEditorPane editorPane = new JEditorPane("text/html", html); |
23 | editorPane.setEditable(false); |
24 | editorPane.addHyperlinkListener(new HyperlinkListener { |
25 | public void hyperlinkUpdate(HyperlinkEvent e) { |
26 | print("Event! " + e.getEventType() + " " + e.getDescription() + " " + e.getURL()); |
27 | } |
28 | }); |
29 | showFrame(new JScrollPane(editorPane)); |
30 | } |
Began life as a copy of #1004827
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1004829 |
Snippet name: | Show Tokens [pre-experiment] |
Eternal ID of this version: | #1004829/1 |
Text MD5: | 687bd0f6034e2a68bfff2310154dd5e9 |
Transpilation MD5: | 7373483c2022ce78b11dbf5f3c9ccad3 |
Author: | stefan |
Category: | javax |
Type: | JavaX source code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2016-09-05 15:27:56 |
Source code size: | 1025 bytes / 30 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 528 / 680 |
Referenced in: | [show references] |