Libraryless. Click here for Pure Java version (3549L/21K).
1 | svoid tok_runnableClasses(LS tok) { |
2 | jreplace(tok, "runnable static record", "static runnable record"); |
3 | |
4 | int i; |
5 | while ((i = jfind(tok, "runnable <id> <id>", |
6 | (_tok, nIdx) -> eqOneOf(tok.get(nIdx+3), "record", "class"))) >= 0) { |
7 | int iOpening = indexOf(tok, i, "{"); |
8 | int iClosing = tok_findEndOfBlock(tok, iOpening)-1; |
9 | tokSet_reTok(tok, iClosing, "}}"); |
10 | tokSet_reTok(tok, iOpening, "implements Runnable { run {"); |
11 | clearTokens_reTok(tok, i, i+2); |
12 | } |
13 | |
14 | /*replaceKeywordBlock(tok, "runnable class <id>", |
15 | "class $3 implements Runnable { run {", |
16 | "}}");*/ |
17 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1027547 |
Snippet name: | tok_runnableClasses (and records) |
Eternal ID of this version: | #1027547/5 |
Text MD5: | 3225fc128e6886d8936fda5ce879b794 |
Transpilation MD5: | 635ae99b3ae2062ba2487636767e6a2a |
Author: | stefan |
Category: | javax / transpiling |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-04-05 13:28:45 |
Source code size: | 607 bytes / 17 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 213 / 327 |
Version history: | 4 change(s) |
Referenced in: | [show references] |