Libraryless. Click here for Pure Java version (3614L/24K/80K).
1 | !752 |
2 | |
3 | !include #1004828 // Java Analysis |
4 | |
5 | sS snippetID = "#1004812"; |
6 | |
7 | p { |
8 | loadConcepts(); |
9 | autoSaveConcepts(); |
10 | |
11 | deleteAll(JavaToken.class); |
12 | |
13 | // load snippet (SSnippet) if we don't have it yet |
14 | |
15 | ensureHas(SSnippet.class, r { |
16 | new SSnippet s; |
17 | s.snippetID = snippetID; |
18 | s.grabbedWhen = now(); |
19 | s.text = loadSnippet(snippetID); |
20 | }); |
21 | |
22 | // Do a javaTok on every snippet |
23 | |
24 | ensureHas(SSnippet.class, JavaTok.class, voidfunc(SSnippet s) { |
25 | new JavaTok j; |
26 | j.onSnippet.set(s); |
27 | assertNotNull(s.text); |
28 | j.text = s.text; |
29 | j.tok = javaTok(s.text); |
30 | }); |
31 | |
32 | // Make the tokens |
33 | |
34 | forEvery(JavaTok.class, voidfunc(JavaTok j) { |
35 | if (j.tok == null) ret; |
36 | |
37 | // Find existing tokens |
38 | |
39 | Map<Int, JavaToken> tokens = indexByField(findBackRefs(j, JavaToken.class), "index"); |
40 | |
41 | // Let's just do the C tokens |
42 | |
43 | int charIndex = 0; |
44 | for (int i = 0; i < l(j.tok); i++) { |
45 | if (odd(i) && tokens.get(i) == null) |
46 | new JavaToken(j, i, charIndex); |
47 | charIndex += l(j.tok.get(i)); |
48 | } |
49 | }); |
50 | } |
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: | #1004820 |
Snippet name: | Java Analysis AI (dev.) |
Eternal ID of this version: | #1004820/1 |
Text MD5: | ff8e1ef96e62f3a2adc21a2d57d2024f |
Transpilation MD5: | 2ccfcca94a22f5f3bf9d6f08c850fab5 |
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:31:03 |
Source code size: | 1112 bytes / 50 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 648 / 1274 |
Referenced in: | [show references] |