1 | sS ai_groupLeftAndRightOfPhrase(S phrase, S s) { |
2 | ret ai_groupLeftAndRightOfPhrase(phrase, javaTokWithBrackets(s)); |
3 | } |
4 | |
5 | sS ai_groupLeftAndRightOfPhrase(S phrase, LS tok) { |
6 | S[] _phrase = toStringArray(javaTokC(phrase)); |
7 | int i = findCodeTokensIC(tok, _phrase); |
8 | if (i < 0) ret join(tok); |
9 | ret first(tok) + curly(joinSubList(tok, 1, i-1)) |
10 | + joinSubList(tok, i-1, i+l(_phrase)*2) |
11 | + curly(joinSubList(tok, i+l(_phrase)*2, l(tok)-1)) |
12 | + last(tok); |
13 | } |
Began life as a copy of #1021988
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1022961 |
Snippet name: | ai_groupLeftAndRightOfPhrase |
Eternal ID of this version: | #1022961/4 |
Text MD5: | 78a8b6aa0e35da6d31a5e6f62abcf59f |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-04-15 20:32:16 |
Source code size: | 474 bytes / 13 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 281 / 309 |
Version history: | 3 change(s) |
Referenced in: | [show references] |