1 | static L<S> javaTokNPunctuation_bracketsInC(S s) {
|
2 | L<S> tok = javaTok(s); |
3 | for (int i = 1; i < l(tok); i += 2) {
|
4 | int j = i; |
5 | S t; |
6 | char c; |
7 | while (j < l(tok) |
8 | && l(t = tok.get(j)) == 1 |
9 | && !Character.isLetterOrDigit(c = t.charAt(0)) |
10 | && "{}()".indexOf(c) < 0)
|
11 | j += 2; |
12 | if (j > i) |
13 | // j points to next C token after mergeable stuff |
14 | replaceSubList(tok, i-1, j, ll(joinSubList(tok, i-1, j))); |
15 | } |
16 | ret tok; |
17 | } |
Began life as a copy of #1017442
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: | #1021422 |
| Snippet name: | javaTokNPunctuation_bracketsInC - put words + curly & round brackets in C, punctuation + spacing in N |
| Eternal ID of this version: | #1021422/3 |
| Text MD5: | 8328c5caa2bfd46e92bdb3790d645cda |
| Author: | stefan |
| Category: | javax / tokenizing |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-02-11 16:43:20 |
| Source code size: | 475 bytes / 17 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 523 / 573 |
| Version history: | 2 change(s) |
| Referenced in: | [show references] |