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

36
LINES

< > BotCompany Repo | #1019998 // transpileLocalSnippet [dev.]

JavaX fragment (include)

svoid transpileLocalSnippet(S progID) {
  transpileLocalSnippet(progID, "quick");
}

svoid transpileLocalSnippet(S progID, S mode) {
  if (neq(mode, 'quick)) refreshTranspiler();
  S javax = loadLocalSnippet(progID);

  time "Transpile" {
    transpileRaw_silent = false;
    S java;
    try {
      java = transpileRaw(javax);
    } catch e {
      // (line 980,col 1)
      int line = parseIntOpt(jextract("(line <int>,", str(e)));
      if (line != 0) {
        L<S> lines = lines(loadProgramTextFile("error.java"));
        for (int i = line-1; i <= line+1; i++)
          print("[line " + i + "] " + get(lines, i-1));
      }
      throw rethrow(e);
    }
    print("Transpiled to " + l(java) + " chars");
  }

  new L<S> libs;
  java = findTranslators2(java, libs);
  print("Libs: " + or2(joinWithComma(libs), "-"));

  S dehlibs = join(" ", libs);
  saveTranspiledCode(progID, dehlibs + "\n" + java);
  
  File bytecode = javaCompile_overInternalBot(java, dehlibs);
  print("Bytecode: " + f2s(assertNotNull(bytecode)));
}

download  show line numbers  debug dex  old transpilations   

Travelled to 9 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1019998
Snippet name: transpileLocalSnippet [dev.]
Eternal ID of this version: #1019998/2
Text MD5: 983cdfa3fa19ed7d73948e1e76ac96df
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-16 20:07:39
Source code size: 1063 bytes / 36 lines
Pitched / IR pitched: No / No
Views / Downloads: 269 / 318
Version history: 1 change(s)
Referenced in: [show references]