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

7
LINES

< > BotCompany Repo | #1030884 // tok_returnAsFunctionName - converts "return" and "ret" to "_return" when used as function names

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

Libraryless. Click here for Pure Java version (5329L/30K).

1  
svoid tok_returnAsFunctionName(LS tok) {
2  
  // distinguish from end of meta command
3  
  ITokCondition cond = (_tok, nIdx) -> empty(get(tok, nIdx+2));
4  
  
5  
  jreplace(tok, ".ret", "._return", cond);
6  
  jreplace(tok, ".return", "._return", cond);
7  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030884
Snippet name: tok_returnAsFunctionName - converts "return" and "ret" to "_return" when used as function names
Eternal ID of this version: #1030884/4
Text MD5: 2c20ba2a622dbdbb5ba0d4a543525665
Transpilation MD5: eeff93752086f595d424c343de6c99c3
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-01 22:06:22
Source code size: 246 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 175 / 277
Version history: 3 change(s)
Referenced in: [show references]