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

15
LINES

< > BotCompany Repo | #1021069 // javaTokNPunctuation_plusAsterisk

JavaX fragment (include)

static L<S> javaTokNPunctuation_plusAsterisk(S s) {
  L<S> tok = javaTok(s);
  for (int i = 1; i < l(tok); i += 2) {
    int j = i;
    S t;
    while (j < l(tok) && l(t = tok.get(j)) == 1
      && !Character.isLetterOrDigit(t.charAt(0))
      && t.charAt(0) != '*')
        j += 2;
    if (j > i)
      // j points to next C token after mergeable stuff
      replaceSubList(tok, i-1, j, ll(joinSubList(tok, i-1, j)));
  }
  ret tok;
}

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: 238 / 271
Referenced in: [show references]