Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

11
LINES

< > BotCompany Repo | #1023092 - tok_for_single

JavaX fragment (include)

svoid tok_for_single(LS tok) {
  int i = -1;
  while ((i = jfind(tok, i+1, "for single (")) >= 0) {
    int iColon = indexOf(tok, ":", i);
    int iClosing = findEndOfBracketPart(tok, iColon)-1;
    tok.set(iColon, ": singletonUnlessNull(");
    tok.set(iClosing, "))");
    clearTokens(tok, i+2, i+4);
    reTok(tok, i, iClosing+1);
  }
}

Author comment

Began life as a copy of #1023091

download  show line numbers  debug dex   

Travelled to 3 computer(s): cfunsshuasjs, mqqgnosmbjvj, tvejysmllsmz

No comments. add comment

Snippet ID: #1023092
Snippet name: tok_for_single
Eternal ID of this version: #1023092/1
Text MD5: d9a44724416d062346300518a71b25c6
Author: stefan
Category: javax / transpiling
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-05-03 03:56:05
Source code size: 349 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 41 / 53
Referenced in: [show references]

Formerly at http://tinybrain.de/1023092 & http://1023092.tinybrain.de