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

15
LINES

< > BotCompany Repo | #1021069 // javaTokNPunctuation_plusAsterisk

JavaX fragment (include)

1  
static L<S> javaTokNPunctuation_plusAsterisk(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  
      && t.charAt(0) != '*')
9  
        j += 2;
10  
    if (j > i)
11  
      // j points to next C token after mergeable stuff
12  
      replaceSubList(tok, i-1, j, ll(joinSubList(tok, i-1, j)));
13  
  }
14  
  ret tok;
15  
}

Author comment

Began life as a copy of #1017442

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1021069
Snippet name: javaTokNPunctuation_plusAsterisk
Eternal ID of this version: #1021069/1
Text MD5: aa7e4ac6f8779ea32933550adfa4c7b5
Author: stefan
Category: javax / tokenizing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-01-20 15:05:02
Source code size: 449 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 301 / 339
Referenced in: [show references]