Libraryless. Click here for Pure Java version (2760L/18K).
sS tok_applyCurlyTransformers(IF1<S, IF1<S>> getTransformer, S s) { ret join(tok_applyCurlyTransformers(getTransformer, javaTok(s))); } static LS tok_applyCurlyTransformers(IF1<S, IF1<S>> getTransformer, LS tok) { for (int iSlash : jfindAll(tok, "/<id>}")) { int iClosing = iSlash+4; IF1<S> transformer = getTransformer.get(tok.get(iSlash+2)); if (transformer == null) continue; int iOpening = findBeginningOfBracketPart(tok, iClosing); if (iOpening < 0) continue; S transformed = transformer.get(joinSubList(tok, iOpening+1, iSlash-1)); replaceTokens(tok, iOpening, iClosing+1, transformed); } ret tok; }
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1026167 |
Snippet name: | tok_applyCurlyTransformers |
Eternal ID of this version: | #1026167/2 |
Text MD5: | 287cbfec0b384295381da574bbb98daa |
Transpilation MD5: | f86770f9b6a9157751aab3d2331da91c |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-11-27 17:26:01 |
Source code size: | 657 bytes / 16 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 190 / 291 |
Version history: | 1 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) |