static S renameDollarVarsTo123(S s) { ret renameDollarVarsTo123(javaTok(s)); } static S renameDollarVarsTo123(LS tok) { new SS map; for (int i = 1; i < l(tok); i += 2) { S t = tok.get(i); if (isDollarVar(t)) { S v = map.get(t); if (v == null) map.put(t, v = "$" + (l(map)+1)); tok.set(i, v); } } ret join(tok); }
Began life as a copy of #1010854
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1018260 |
Snippet name: | renameDollarVarsTo123 |
Eternal ID of this version: | #1018260/1 |
Text MD5: | 90d66840ba69294c58d4482c1fd5ef17 |
Author: | stefan |
Category: | javax / parsing |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-09-12 18:30:13 |
Source code size: | 377 bytes / 17 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 305 / 337 |
Referenced in: | [show references] |