Transpiled version (2508L) is out of date.
1 | // returns L<S|L> |
2 | static L recursiveJavaTok(S s) { |
3 | L tok = cloneList(javaTokWithBrackets(s)); |
4 | for (int i = 1; i < l(tok); i += 2) { |
5 | S t = cast tok.get(i); |
6 | if (startsWithOneOf(t, "(", "{")) { |
7 | L sub = recursiveJavaTok(dropFirstAndLast(t)); |
8 | |
9 | // add brackets to inner N tokens |
10 | sub.set(0, first(sub) + takeFirst(1, t)); |
11 | sub.set(l(sub)-1, takeLast(1, t) + last(sub)); |
12 | |
13 | tok.set(i, sub); |
14 | } |
15 | } |
16 | ret tok; |
17 | } |
Began life as a copy of #1027139
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: | #1027158 |
Snippet name: | recursiveJavaTok |
Eternal ID of this version: | #1027158/11 |
Text MD5: | ff91912cf5405c0eb495d5e160ce01db |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-02-22 17:32:12 |
Source code size: | 472 bytes / 17 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 192 / 303 |
Version history: | 10 change(s) |
Referenced in: | [show references] |