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

14
LINES

< > BotCompany Repo | #1017442 // javaTokNPunctuation - put words in C, punctuation + spacing in N

JavaX fragment (include)

1  
static L<S> javaTokNPunctuation(S s) {
2  
  L<S> tok = javaTok(s);
3  
  for (int i = 1; i < l(tok); i += 2) {
4  
    int j = i;
5  
    S t;
6  
    while (j < l(tok) && l(t = tok.get(j)) == 1
7  
      && !Character.isLetterOrDigit(t.charAt(0)))
8  
        j += 2;
9  
    if (j > i)
10  
      // j points to next C token after mergeable stuff
11  
      replaceSubList(tok, i-1, j, ll(joinSubList(tok, i-1, j)));
12  
  }
13  
  ret tok;
14  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1017442
Snippet name: javaTokNPunctuation - put words in C, punctuation + spacing in N
Eternal ID of this version: #1017442/4
Text MD5: 2442aee99517824d460fb8d0cc96d50a
Author: stefan
Category: javax / tokenizing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-09-11 13:11:33
Source code size: 407 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 441 / 1071
Version history: 3 change(s)
Referenced in: [show references]