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

14
LINES

< > BotCompany Repo | #1020961 // tok_makeArgumentsFinal

JavaX fragment (include)

1  
// iOpening, iClosing = position of () brackets
2  
static LS tok_makeArgumentsFinal(LS tok, int iOpening, int iClosing) {
3  
  Map<Int> bracketMap = getBracketMapIncludingAngleBrackets(tok, iOpening+2, iClosing);
4  
  bool change = false;
5  
  int i = iOpening+2;
6  
  while (i < iClosing) {
7  
    if (neqGet(tok, i, "final")) { tokPrepend(tok, i, "final "); set change; }
8  
    while (i < iClosing && neqGet(tok, i, ","))
9  
      i = or(bracketMap.get(i), i)+2;
10  
    i += 2;
11  
  }
12  
  if (change) reTok(tok, iOpening, iClosing);
13  
  ret tok;
14  
}

Author comment

Began life as a copy of #1020910

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: #1020961
Snippet name: tok_makeArgumentsFinal
Eternal ID of this version: #1020961/6
Text MD5: 44377ecad5b7bdb92a8bd1f6b343ff28
Author: stefan
Category: javax / transpiling
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-01-12 21:50:38
Source code size: 529 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 338 / 388
Version history: 5 change(s)
Referenced in: [show references]