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

16
LINES

< > BotCompany Repo | #1001452 // Smart Editor: Apply Translator

JavaX fragment (include)

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;
  }
}

Author comment

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: 664 / 905
Referenced in: [show references]