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

8
LINES

< > BotCompany Repo | #1016575 // lineAroundToken

JavaX fragment (include)

static S lineAroundToken(L<S> tok, int tokenIndex) {
  int i = tokenIndex, j = tokenIndex;
  while (i > 1 && !containsNewLine(get(tok, i-1)))
    i -= 2;
  while (j+2 < l(tok) && !containsNewLine(get(tok, j+1)))
    j += 2;
  ret afterLineBreak(get(tok, i-1)) + joinSubList(tok, i, j+1) + beforeLineBreak(get(tok, j+1));
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1016575
Snippet name: lineAroundToken
Eternal ID of this version: #1016575/4
Text MD5: 351288237efdd76bb97be3a4315909af
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-24 00:42:35
Source code size: 329 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 295 / 322
Version history: 3 change(s)
Referenced in: [show references]