Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

13
LINES

< > BotCompany Repo | #1010092 // tok_findImports

JavaX fragment (include)

1  
// finds static imports too
2  
static List<String> tok_findImports(L<S> tok) {
3  
  new L<S> imports;
4  
  int n = l(tok);
5  
  for (int i = 1; i < n; i += 2)
6  
    if (eq(tok.get(i), "import")) {
7  
      int j = indexOf(tok, ";", i+2);
8  
      if (j < 0) break;
9  
      imports.add(joinCodeTokens(subList(tok, i-1, j)));
10  
      i = j;
11  
    }
12  
  ret imports;
13  
}

Author comment

Began life as a copy of #1002768

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: #1010092
Snippet name: tok_findImports
Eternal ID of this version: #1010092/3
Text MD5: 6c58c3af174c6bbd5eaa1307a6326095
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-06-29 03:45:59
Source code size: 349 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 438 / 491
Version history: 2 change(s)
Referenced in: [show references]