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

22
LINES

< > BotCompany Repo | #1020910 // tok_makeArgumentsToAllFunctionsFinal

JavaX fragment (include)

1  
static LS tok_makeArgumentsToAllFunctionsFinal(LS tok) {
2  
  bool change = false;
3  
  for (LS tokF : findFullFunctionDefs(tok, true)) {
4  
    IntRange r = tok_findArgs(tokF);
5  
    if (r == null) continue;
6  
    //print("Args: " + subList(tokF, r));
7  
    Map<Int> bracketMap = getBracketMapIncludingAngleBrackets(tokF);
8  
    int i = r.start+1;
9  
    while (i < r.end-2) {
10  
      if (neqGet(tokF, i, "final")) { tokPrepend(tokF, i, "final "); set change; }
11  
      while (i < r.end && neqGet(tokF, i, ","))
12  
        i = or(bracketMap.get(i), i)+2;
13  
      i += 2;
14  
    }
15  
  }
16  
  if (change) reTok(tok);
17  
  ret tok;
18  
}
19  
20  
sS tok_makeArgumentsToAllFunctionsFinal(S s) {
21  
  ret join(tok_makeArgumentsToAllFunctionsFinal(javaTok(s)));
22  
}

Author comment

Began life as a copy of #1019709

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: #1020910
Snippet name: tok_makeArgumentsToAllFunctionsFinal
Eternal ID of this version: #1020910/11
Text MD5: 5f3c29d3777769ce9e6b372cdfaa8ab5
Author: stefan
Category: javax / transpiling
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-01-09 20:55:35
Source code size: 724 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 296 / 354
Version history: 10 change(s)
Referenced in: [show references]