if (s.startsWith("!")) { S translator = s.substring(1); if (isSnippetID(translator)) { File x = tempDir(); S oldText = getText(); saveTextFile(new File(x, "main.java"), oldText); ArrayList<File> libraries_out = new ArrayList<File>(); File y = cast call(getJavaX(), "applyTranslator", x, translator, "", libraries_out); S text = loadTextFile(new File(y, "main.java")); if (text == null) ret "hm."; boolean same = eq(oldText, text); setText(text); ret same ? "OK - no change" : "OK, applied !" + translator; } }
Began life as a copy of #1001451
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: | #1001452 |
Snippet name: | Smart Editor: Apply Translator |
Eternal ID of this version: | #1001452/1 |
Text MD5: | 11ddda82ef8b3b1b7e468b4989e7ecf0 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2015-10-16 20:05:12 |
Source code size: | 578 bytes / 16 lines |
Pitched / IR pitched: | No / Yes |
Views / Downloads: | 668 / 910 |
Referenced in: | #1001410 - Smart Editor (developing) #3000382 - Answer for ferdie (>> t = 1, f = 0) #3000383 - Answer for funkoverflow (>> t=1, f=0 okay) |