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

11
LINES

< > BotCompany Repo | #1032536 // tok_getFromMap

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (4519L/26K).

// S name from req; => S name = req?.get("name");
svoid tok_getFromMap(LS tok) {
  int i;
  jreplace_dyn_allowNull(tok, "<id> <id> from <id>;",
    (_tok, start, end) -> {
      S type = tok.get(start);
      S var = tok.get(start+2);
      S map = tok.get(start+6);
      ret type + " " + var + " = " + map + "?.get(" + quote(var) + ");";
    });
}
  

Author comment

Began life as a copy of #1031876

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1032536
Snippet name: tok_getFromMap
Eternal ID of this version: #1032536/5
Text MD5: a26e5adee315980fd08b5f9e6d924b57
Transpilation MD5: bdf3286f7efe97a6c37349ba3d7ea3cb
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-09-20 17:57:51
Source code size: 363 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 190 / 242
Version history: 4 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)