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

11
LINES

< > BotCompany Repo | #1032337 // tok_dropImports - drop all imports from Java code

JavaX fragment (include)

1  
static LS tok_dropImports(LS tok) {
2  
  LS index = toContentsIndexedList(tok);
3  
  L<IntRange> imports = tok_findImports_returnRanges(tok);
4  
  for (IntRange r : imports)
5  
    clearTokens(tok, r);
6  
  ret tok;
7  
}
8  
9  
sS tok_dropImports(S s) {
10  
  ret join(tok_dropImports(javaTok(s)));
11  
}

Author comment

Began life as a copy of #1031283

download  show line numbers  debug dex  old transpilations   

Travelled to 5 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1032337
Snippet name: tok_dropImports - drop all imports from Java code
Eternal ID of this version: #1032337/1
Text MD5: 8fde60dd0b4d3b4d4273e3f4271fdf75
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-28 18:09:12
Source code size: 282 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 135 / 164
Referenced in: [show references]