1 | static L<S> findBlock(S pat, L<S> tok) {
|
2 | L<S> tokpat = javaTok(pat); |
3 | int i = findCodeTokens(tok, toStringArray(codeTokensOnly(tokpat))); |
4 | //print("index of block " + quote(pat) + ": " + i);
|
5 | if (i < 0) ret null; |
6 | int bracketIdx = i+tokpat.size()-3; |
7 | assertEquals("{", tok.get(bracketIdx));
|
8 | int endIdx = findEndOfBlock(tok, bracketIdx); |
9 | ret subList(tok, i-1, endIdx+1); // make it actual CNC |
10 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1001809 |
| Snippet name: | findBlock |
| Eternal ID of this version: | #1001809/2 |
| Text MD5: | 70151c1bd231ecd5639239089de3b5a0 |
| Author: | stefan |
| Category: | |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2017-08-01 02:32:15 |
| Source code size: | 413 bytes / 10 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 949 / 2385 |
| Version history: | 1 change(s) |
| Referenced in: | [show references] |