Transpiled version (5799L) is out of date.
svoid tok_cachedFunctions_new(LS tok) { pcall { int i = -1; while ((i = jfind(tok, i+1, "cached <id>")) >= 0) { Cl<S> modifiers = tok_modifiersLeftOf(tok, i); int iMod = tok_leftScanModifiers(tok, i); int bracket = indexOf(tok, "(", i); S fName = assertIdentifier(tok.get(bracket-2)); int iMod2 = tok_rightScanModifiers(tok, i+2); printVars tok_cachedFunctions_new(+modifiers); modifiers.addAll(codeTokensFromSubList(tok, i+2, iMod2)); S type = joinSubList(tok, iMod2, bracket-3); S boxedType = tok_toNonPrimitiveTypes(type); S mods = joinWithSpace(listMinus(modifiers, "final")); S mods2 = joinWithSpace(listMinus(modifiers, "transient")); printVars tok_cachedFunctions_new(+mods, +mods2); replaceTokens_reTok(tok, iMod, bracket-1, "\*mods*/ Cache<\*boxedType*/> \*fName*/_cache = new Cache<>(lambda0 \*fName*/_load);\n" + "\*mods2*/ \*type*/ \*fName*/() { ret \*fName*/_cache!; }\n\n" + "\*mods2*/ \*boxedType*/ \*fName*/_load"); } }}
Began life as a copy of #1020989
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1034364 |
Snippet name: | tok_cachedFunctions_new |
Eternal ID of this version: | #1034364/4 |
Text MD5: | d7d8568256bba26d426885cbc3a7d3db |
Author: | stefan |
Category: | javax / transpiling |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-02-03 08:06:25 |
Source code size: | 1038 bytes / 22 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 143 / 208 |
Version history: | 3 change(s) |
Referenced in: | [show references] |