Handles loading of keywords file. Uses getKeywords() method because that's part of the TokenMarker classes. It is recommended that a # sign be used for comments inside keywords.txt.
()
| 82 | * inside keywords.txt. |
| 83 | */ |
| 84 | public void reload() { |
| 85 | try { |
| 86 | parseKeywordsTxt(new File(BaseNoGui.getContentFile("lib"), "keywords.txt")); |
| 87 | TargetPlatform tp = BaseNoGui.getTargetPlatform(); |
| 88 | if (tp != null) { |
| 89 | File platformKeywords = new File(tp.getFolder(), "keywords.txt"); |
| 90 | if (platformKeywords.exists()) parseKeywordsTxt(platformKeywords); |
| 91 | } |
| 92 | for (UserLibrary lib : BaseNoGui.librariesIndexer.getInstalledLibraries()) { |
| 93 | File keywords = new File(lib.getInstalledFolder(), "keywords.txt"); |
| 94 | if (keywords.exists()) { |
| 95 | parseKeywordsTxt(keywords); |
| 96 | } |
| 97 | } |
| 98 | } catch (Exception e) { |
| 99 | Base.showError("Problem loading keywords", "Could not load keywords.txt,\nplease re-install Arduino.", e); |
| 100 | System.exit(1); |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | private void parseKeywordsTxt(File input) throws Exception { |
| 105 | BufferedReader reader = null; |