1 | // assumes that it's a list of statements; return them one by one |
2 | static L<L<S>> statements(L<S> tok) { |
3 | new L<L<S>> l; |
4 | int i = 0; |
5 | while (i < l(tok)) { |
6 | int j = indexOf(tok, ";", i); |
7 | if (j < 0) { |
8 | if (l(tok)-i >= 3) |
9 | l.add(tok.subList(i, l(tok))); |
10 | break; |
11 | } else { |
12 | l.add(tok.subList(i, j+2)); // actual CNC - we may return some comments twice, but we don't look at them anyways. |
13 | i = j+1; // go to non-code token |
14 | } |
15 | } |
16 | ret l; |
17 | } |
18 | |
19 | static L<L<S>> statements(S s) { |
20 | ret statements(javaTok(s)); |
21 | } |
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: | #1001879 |
Snippet name: | statements |
Eternal ID of this version: | #1001879/1 |
Text MD5: | 6286d67100b6c09704487a0720455098 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2015-12-01 21:27:33 |
Source code size: | 563 bytes / 21 lines |
Pitched / IR pitched: | No / Yes |
Views / Downloads: | 691 / 923 |
Referenced in: | [show references] |