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

11
LINES

< > BotCompany Repo | #1031772 // tok_numberFunctionNames (e.g. "1to" => "oneTo") - possible shortening with ellipses

JavaX fragment (include)

1  
svoid tok_numberFunctionNames(...) {
2  
  int n = ...;
3  
  ... reToks;
4  
  for (int i = 1; i < n-2; i += 2) {
5  
    S number, id;
6  
    if (isInteger(number = tok.get(i)) && empty(tok.get(i+1)) && isIdentifier(id = tok.get(i+2))) pcall {
7  
      replaceTokens_reTokLater(..., i, i+3, camelCase(numberToEnglish(parseLong(number))) + firstToUpper(id));
8  
    }
9  
  }
10  
  reTok_multi(...);
11  
}

Author comment

Began life as a copy of #1031769

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1031772
Snippet name: tok_numberFunctionNames (e.g. "1to" => "oneTo") - possible shortening with ellipses
Eternal ID of this version: #1031772/2
Text MD5: c78f9190f23522391499c3a11af05873
Author: stefan
Category: javax / transpiling
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-06-29 15:05:18
Source code size: 379 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 126 / 152
Version history: 1 change(s)
Referenced in: [show references]