Libraryless. Click here for Pure Java version (3040L/18K).
1 | static LS ai_turnCertainWordsIntoUniqueDollarVars(Set<S> wordsToTransform, LS tok) { |
2 | MultiSet<S> ms = ciMultiSet(); |
3 | ret mapWithIndex(tok, (i, t) -> |
4 | odd(i) && contains(wordsToTransform, t) ? "$" + t + addPrefixIfNempty("_", emptyIfOne(ms.add(t))) : t); |
5 | } |
6 | |
7 | sS ai_turnCertainWordsIntoUniqueDollarVars(Set<S> wordsToTransform, S s) { |
8 | ret join(ai_turnCertainWordsIntoUniqueDollarVars(wordsToTransform, javaTok(s))); |
9 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1027132 |
Snippet name: | ai_turnCertainWordsIntoUniqueDollarVars |
Eternal ID of this version: | #1027132/7 |
Text MD5: | bde041c0b62bc2ea5807f4a1d10b20c7 |
Transpilation MD5: | 6e8025c1d2a3fc3c9f419c4c66f6d9f1 |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-03-29 20:03:47 |
Source code size: | 432 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 271 / 374 |
Version history: | 6 change(s) |
Referenced in: | [show references] |