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

22
LINES

< > BotCompany Repo | #1020910 // tok_makeArgumentsToAllFunctionsFinal

JavaX fragment (include)

static LS tok_makeArgumentsToAllFunctionsFinal(LS tok) {
  bool change = false;
  for (LS tokF : findFullFunctionDefs(tok, true)) {
    IntRange r = tok_findArgs(tokF);
    if (r == null) continue;
    //print("Args: " + subList(tokF, r));
    Map<Int> bracketMap = getBracketMapIncludingAngleBrackets(tokF);
    int i = r.start+1;
    while (i < r.end-2) {
      if (neqGet(tokF, i, "final")) { tokPrepend(tokF, i, "final "); set change; }
      while (i < r.end && neqGet(tokF, i, ","))
        i = or(bracketMap.get(i), i)+2;
      i += 2;
    }
  }
  if (change) reTok(tok);
  ret tok;
}

sS tok_makeArgumentsToAllFunctionsFinal(S s) {
  ret join(tok_makeArgumentsToAllFunctionsFinal(javaTok(s)));
}

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: 219 / 273
Version history: 10 change(s)
Referenced in: [show references]