1 | // finds "<keyword> <quoted> {" and "<keyword> <id> {"
|
2 | // func: tok, C token index of keyword -> S[] {beg, end}
|
3 | static L<S> replaceKeywordPlusQuotedOrIDBlock(L<S> tok, S keyword, O func) {
|
4 | for (int i = 0; i < 1000; i++) {
|
5 | int idx = jfind_any(tok, keyword + " <quoted> {", keyword + " <id> {");
|
6 | if (idx < 0) |
7 | break; |
8 | int j = findEndOfBracketPart(tok, idx+4); |
9 | |
10 | S[] be = (S[]) callF(func, tok, idx); |
11 | tok.set(idx, be[0]); |
12 | clearTokens(tok, idx+1, idx+5); |
13 | tok.set(j-1, be[1]); |
14 | reTok(tok, idx, j); |
15 | } |
16 | ret tok; |
17 | } |
Began life as a copy of #1009010
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: | #1025503 |
| Snippet name: | replaceKeywordPlusQuotedOrIDBlock |
| Eternal ID of this version: | #1025503/1 |
| Text MD5: | 3bea929595cf695abffe95cd6f6da969 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-10-01 15:19:23 |
| Source code size: | 565 bytes / 17 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 484 / 500 |
| Referenced in: | [show references] |