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

34
LINES

< > BotCompany Repo | #1005577 // veryQuickJava3 - transpile, compile, load a short code snippet - uses class CompilerBot

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (9926L/66K).

scope veryQuickJava.

static bool veryQuickJava_silent = true;
static bool veryQuickJava_useCompilerBot = true; // we always use it now
static new ThreadLocal<S> veryQuickJava_transpiled;
static O veryQuickJava3_cacheFunction; // func(S, LS) -> Class
static new ThreadLocal<IVF1<S>> #onJavaSource;

// mainJava is a complete program, but without the !752/!759 at the top
// returns link to main class
static Class veryQuickJava3(S mainJava) {
  ret veryQuickJava3(mainJava, emptyList());
}

static Class veryQuickJava3(S mainJava, L<S> libs) {
  Class c = cast callF(veryQuickJava3_cacheFunction, mainJava, libs);
  ifdef veryQuickJava3_debug
    printVars_str("veryQuickJava3: ", +c);
  endifdef
  if (c != null) ret c;
  transpileRaw_silent = veryQuickJava_silent;
  S src = transpileRaw(mainJava); // transpiled, with lib references
  if (empty(src)) {
    printWithIndent("JAVAX> ", mainJava);
    fail("Transpiler returned empty result");
  }
  if (veryQuickJava_transpiled! != null)
    veryQuickJava_transpiled.set(src);
  callF(onJavaSource!, src);
  ifdef veryQuickJava3_debug
    print("veryQuickJava3: veryQuickJava_transpiled=" + shorten_nullOnNull(veryQuickJava_transpiled!));
  endifdef
  ret veryQuickJava_finish(src, libs);
}

Author comment

Began life as a copy of #1003866

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1005577
Snippet name: veryQuickJava3 - transpile, compile, load a short code snippet - uses class CompilerBot
Eternal ID of this version: #1005577/17
Text MD5: 7d58736ad5beb4338853dc206fe35370
Transpilation MD5: d33138f6d78dbc6d5c7862844d8eaf8c
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-06-29 04:21:39
Source code size: 1274 bytes / 34 lines
Pitched / IR pitched: No / No
Views / Downloads: 568 / 653
Version history: 16 change(s)
Referenced in: [show references]