1 | svoid tok_swappableFunctions(LS tok) {
|
2 | int i; |
3 | while ((i = jfind(tok, "swappable <id> <id>() {")) >= 0) {
|
4 | S returnType = tok.get(i+2), name = tok.get(i+4); |
5 | S base = name + "_base"; |
6 | int iCurly = indexOf(tok, i, "{");
|
7 | replaceTokens_reTok(tok, i, iCurly+1, "transient IF0<\*returnType*/> \*name*/;\n" + |
8 | "\*returnType*/ \*name*/() { ret \*name*/ != null ? \*name*/! : \*base*/(); }\n" +
|
9 | "\*returnType*/ \*base*/() {");
|
10 | } |
11 | } |
Began life as a copy of #1026384
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: | #1026407 |
| Snippet name: | tok_swappableFunctions v1 [simple demo case only] |
| Eternal ID of this version: | #1026407/1 |
| Text MD5: | 1526f05b51c9d705ee40b8a2f1c77ff5 |
| Author: | stefan |
| Category: | javax / linux |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2020-01-03 00:05:31 |
| Source code size: | 462 bytes / 11 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 482 / 475 |
| Referenced in: | [show references] |