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

75
LINES

< > BotCompany Repo | #1031745 // transpileRaw7 - transpile with #7 instead of #759

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

Libraryless. Compilation Failed (9850L/65K).

1  
sbool #silent = true;
2  
sbool #useDiskCache;
3  
4  
/*ifdef DynModule
5  
sS transpileRaw7(S mainJava) {
6  
  ret (S) call(dm_transpiler(), 'transpileRaw7, mainJava, false, #useDiskCache);
7  
}
8  
endifdef*/
9  
10  
ifndef DynModule
11  
static Class #trans;
12  
sbool #mine = true;
13  
static bool #verySilent;
14  
static Lock #lock = lock();
15  
16  
static new ThreadLocal<Bool> #asInclude;
17  
18  
static S transpileRaw7(S mainJava) {
19  
  ret transpileRaw7(mainJava, false, #useDiskCache);
20  
}
21  
22  
static S transpileRaw7(S mainJava, bool fragment) {
23  
  ret transpileRaw7(mainJava, fragment, #useDiskCache);
24  
}
25  
26  
static S transpileRaw7(S mainJava, bool fragment, bool useDiskCache) {
27  
  mainJava = dropTranslators(mainJava);
28  
  lock #lock;
29  
  
30  
  File cacheFile = null;
31  
  if (useDiskCache) {
32  
    cacheFile = new File(javaxCodeDir(), "Transpilations/" + uniqueFileNameUsingMD5_80_v2(mainJava) + ".java");
33  
    try answer loadTextFile(cacheFile);
34  
  }
35  
  
36  
  temp #verySilent ? null : tempLoadingAnim("Transpiling...");
37  
  
38  
  #translator();
39  
 
40  
  //setOpt(#trans, dontPrintSource := true);
41  
  setOpt(#trans, localStuffOnly := fragment);
42  
  setOpt(#trans, asInclude := isTrue(#asInclude!));
43  
  set(#trans, +mainJava);
44  
  // TODO: setOpt(#trans, transpilingSnippetID := );
45  
  set(#trans, +print_byThread);
46  
  if (!#verySilent)
47  
    print("Running translator " + getOpt(#trans, 'programID));
48  
  callMain(#trans);
49  
  //print("Ran translator " + identityHashCode(#trans));
50  
  S main = cast get(#trans, "mainJava");
51  
  if (useDiskCache) {
52  
    saveTextFile(new File(cacheFile.getPath() + "x"), mainJava);
53  
    saveTextFile(cacheFile, main);
54  
  }
55  
  ret main;
56  
}
57  
58  
static Class #translator() {
59  
  if (#trans == null) {
60  
    //print("Loading translator.");
61  
    #trans = hotwireSharingLibraries_silently(#7);
62  
    #mine = true;
63  
    makeDependent(#trans);
64  
    //print("Loaded translator: " + identityHashCode(#trans));
65  
  }
66  
  setOpt(#trans, "print_silent", #silent);
67  
  ret #trans;
68  
}
69  
70  
svoid cleanMeUp_transpileRaw7 {
71  
  if (#mine)
72  
    cleanUp(#trans);
73  
  #trans = null; // release proactively (it's big)
74  
}
75  
endifndef

Author comment

Began life as a copy of #1003847

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1031745
Snippet name: transpileRaw7 - transpile with #7 instead of #759
Eternal ID of this version: #1031745/1
Text MD5: b7487ec3dc9d0ffd766047dbd04eb086
Transpilation MD5: b7054858e4f730ff97e38dcbbc2995c8
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-06-29 03:53:38
Source code size: 2075 bytes / 75 lines
Pitched / IR pitched: No / No
Views / Downloads: 86 / 140
Referenced in: [show references]