1 | !tok_numberFunctionNames { // short for function definition |
2 | for i { // some loop over i |
3 | if (isInteger(number = tok.get(i)) && empty(tok.get(i+1)) && isIdentifier(id = tok.get(i+2))) pcall { |
4 | if (eq(number, "0") && eqic(id, "x")) continue; |
5 | replaceTokens_reTokLater(i, i+3, camelCase(numberToEnglish(parseLong(number))) + firstToUpper(id)); |
6 | } |
7 | } |
8 | reTok_multi; // shortened function call |
9 | } |
10 | |
11 | // I think the above is still clear enough to figure out! |
12 | // Functions get their "typical arguments" with typical types |
13 | // and always the same name. It must be possible to automate that! |
14 | // i goes over any index where the loop body makes any sense |
15 | // (determinable by looking at the calls to tok.get). |
Began life as a copy of #1031772
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt
No comments. add comment
Snippet ID: | #1031773 |
Snippet name: | tok_numberFunctionNames (e.g. "1to" => "oneTo") - possible shortening level 2 |
Eternal ID of this version: | #1031773/5 |
Text MD5: | f77099b2cc9c112fe857259643410bef |
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:11:10 |
Source code size: | 755 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 132 / 158 |
Version history: | 4 change(s) |
Referenced in: | [show references] |