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

13
LINES

< > BotCompany Repo | #1010092 // tok_findImports

JavaX fragment (include)

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

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: 436 / 487
Version history: 2 change(s)
Referenced in: [show references]