Libraryless. Click here for Pure Java version (3126L/20K).
1 | svoid tok_swapStatement(LS tok) { |
2 | jreplace_dyn(tok, "swap <id> <id>, <id>;", (_tok, cIdx) -> { |
3 | S var = makeVar(), type = tok.get(cIdx+2), |
4 | v1 = tok.get(cIdx+4), v2 = tok.get(cIdx+8); |
5 | ret "{ \*type*/ \*var*/ = \*v1*/; \*v1*/ = \*v2*/; \*v2*/ = \*var*/; }"; |
6 | }); |
7 | } |
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: | #1027994 |
Snippet name: | tok_swapStatement |
Eternal ID of this version: | #1027994/2 |
Text MD5: | 8adaaf1876dfccc20169165619fd920d |
Transpilation MD5: | 296a12d2c78cf21994a5dde8e8345dce |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-04-26 18:10:31 |
Source code size: | 290 bytes / 7 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 200 / 296 |
Version history: | 1 change(s) |
Referenced in: | [show references] |