1 | // for single () iterates once when the expression is not null |
2 | // and zero times when it is null. |
3 | // It was actually used once. |
4 | svoid tok_for_single(LS tok) { |
5 | int i = -1; |
6 | while ((i = jfind(tok, i+1, "for single (")) >= 0) { |
7 | int iColon = indexOf(tok, ":", i); |
8 | int iClosing = findEndOfBracketPart(tok, iColon)-1; |
9 | tok.set(iColon, ": singletonUnlessNull("); |
10 | tok.set(iClosing, "))"); |
11 | clearTokens(tok, i+2, i+4); |
12 | reTok(tok, i, iClosing+1); |
13 | } |
14 | } |
Began life as a copy of #1023091
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1023092 |
Snippet name: | tok_for_single |
Eternal ID of this version: | #1023092/2 |
Text MD5: | 7fd130f4d6dee6017369d30f9ba40794 |
Author: | stefan |
Category: | javax / transpiling |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-08-21 04:40:40 |
Source code size: | 480 bytes / 14 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 314 / 368 |
Version history: | 1 change(s) |
Referenced in: | [show references] |