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

13
LINES

< > BotCompany Repo | #1017958 // tok_addFieldOrder

JavaX fragment (include)

static void tok_addFieldOrder(L<S> tok, int i) {
  int idx = findCodeTokens(tok, i, false, "{");
  if (idx < 0) ret;
  int j = findEndOfBracketPart(tok, idx);
  L<S> vars = allVarNames(subList(tok, idx+1, j-1));
  //print("addFieldOrder " + struct(vars));
  if (nempty(vars) && !vars.contains("_fieldOrder")
    && !isSortedList(vars)) {
    //print("Adding field order");
    tok.set(idx+2, "static final String _fieldOrder = " + quote(join(" ", vars)) + ";\n  " + tok.get(idx+2));
    // reTok has to be done by caller
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1017958
Snippet name: tok_addFieldOrder
Eternal ID of this version: #1017958/6
Text MD5: bca81f0c3517b5528fb7fda650c4fa7f
Author: stefan
Category: javax / transpiling
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-09-27 18:39:34
Source code size: 538 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 449 / 477
Version history: 5 change(s)
Referenced in: [show references]