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

24
LINES

< > BotCompany Repo | #1015548 // tok_toNonPrimitiveTypes - convert to boxed type

JavaX fragment (include)

static SS tok_toNonPrimitiveTypes_map = mapFromTokens([[
  int Int
  byte Byte
  float Float
  short Short
  double Double
  long Long
  char Character
  bool Bool
  boolean Bool
]]);

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

static L<S> tok_toNonPrimitiveTypes(L<S> tok) {
  for (int i = 1; i < l(tok); i += 2) {
    S t = tok.get(i);
    t = tok_toNonPrimitiveTypes_map.get(t);
    if (t != null && neq(get(tok, i+2), "[")) tok.set(i, t);
  }
  ret tok;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1015548
Snippet name: tok_toNonPrimitiveTypes - convert to boxed type
Eternal ID of this version: #1015548/6
Text MD5: 880baec25a07808320067b616330f5e3
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-06-29 04:56:36
Source code size: 525 bytes / 24 lines
Pitched / IR pitched: No / No
Views / Downloads: 471 / 516
Version history: 5 change(s)
Referenced in: [show references]