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).

1  
scope veryQuickJava.
2  
3  
static bool veryQuickJava_silent = true;
4  
static bool veryQuickJava_useCompilerBot = true; // we always use it now
5  
static new ThreadLocal<S> veryQuickJava_transpiled;
6  
static O veryQuickJava3_cacheFunction; // func(S, LS) -> Class
7  
static new ThreadLocal<IVF1<S>> #onJavaSource;
8  
9  
// mainJava is a complete program, but without the !752/!759 at the top
10  
// returns link to main class
11  
static Class veryQuickJava3(S mainJava) {
12  
  ret veryQuickJava3(mainJava, emptyList());
13  
}
14  
15  
static Class veryQuickJava3(S mainJava, L<S> libs) {
16  
  Class c = cast callF(veryQuickJava3_cacheFunction, mainJava, libs);
17  
  ifdef veryQuickJava3_debug
18  
    printVars_str("veryQuickJava3: ", +c);
19  
  endifdef
20  
  if (c != null) ret c;
21  
  transpileRaw_silent = veryQuickJava_silent;
22  
  S src = transpileRaw(mainJava); // transpiled, with lib references
23  
  if (empty(src)) {
24  
    printWithIndent("JAVAX> ", mainJava);
25  
    fail("Transpiler returned empty result");
26  
  }
27  
  if (veryQuickJava_transpiled! != null)
28  
    veryQuickJava_transpiled.set(src);
29  
  callF(onJavaSource!, src);
30  
  ifdef veryQuickJava3_debug
31  
    print("veryQuickJava3: veryQuickJava_transpiled=" + shorten_nullOnNull(veryQuickJava_transpiled!));
32  
  endifdef
33  
  ret veryQuickJava_finish(src, libs);
34  
}

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: 638 / 742
Version history: 16 change(s)
Referenced in: [show references]