1 | static List<String> findImports(String src) { |
2 | List<String> imports = new ArrayList<String>(); |
3 | Pattern pattern = Pattern.compile("^\\s*import\\s+(.*?)\\s*;"); |
4 | for (String line : toLines(src)) { |
5 | Matcher matcher = pattern.matcher(line); |
6 | if (matcher.find()) |
7 | imports.add(matcher.group(1)); |
8 | } |
9 | return imports; |
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: | #1002768 |
Snippet name: | findImports - use tok_findImports instead! |
Eternal ID of this version: | #1002768/3 |
Text MD5: | 625a8a51cd73d9d5309cac28be4a5a2b |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-09-02 14:06:17 |
Source code size: | 337 bytes / 10 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 692 / 1600 |
Version history: | 2 change(s) |
Referenced in: | [show references] |