1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-11 04:52:21 +02:00

Code generator support

This commit is contained in:
Brian Fiete 2021-12-11 09:08:42 -08:00
parent 195c705a46
commit 73099e4a04
15 changed files with 1472 additions and 83 deletions

View file

@ -94,6 +94,15 @@ namespace IDE.Compiler
[CallingConvention(.Stdcall), CLink]
static extern char8* BfCompiler_GetUsedOutputFileNames(void* bfCompiler, void* bfProject, bool flushQueuedHotFiles, out bool hadOutputChanges);
[CallingConvention(.Stdcall), CLink]
static extern char8* BfCompiler_GetGeneratorTypeDefList(void* bfCompiler);
[CallingConvention(.Stdcall), CLink]
static extern char8* BfCompiler_GetGeneratorInitData(void* bfCompiler, char8* typeDefName, char8* args);
[CallingConvention(.Stdcall), CLink]
static extern char8* BfCompiler_GetGeneratorGenData(void* bfCompiler, char8* typeDefName, char8* args);
[CallingConvention(.Stdcall), CLink]
static extern char8* BfCompiler_GetTypeDefList(void* bfCompiler);
@ -674,17 +683,21 @@ namespace IDE.Compiler
public override void RequestCancelBackground()
{
if ([Friend]mThreadWorker.mThreadRunning)
if (mThreadWorker.mThreadRunning)
{
if ((mNativeBfCompiler != null) && (!gApp.mDeterministic))
BfCompiler_Cancel(mNativeBfCompiler);
}
}
public override void RequestFastFinish()
public override void RequestFastFinish(bool force = false)
{
if ([Friend]mThreadWorker.mThreadRunning || [Friend]mThreadWorkerHi.mThreadRunning)
if (mThreadWorker.mThreadRunning || mThreadWorkerHi.mThreadRunning)
{
if ((!force) &&
((!mThreadWorker.mAllowFastFinish) || (!mThreadWorkerHi.mAllowFastFinish)))
return;
if ((mNativeBfCompiler != null) && (!gApp.mDeterministic))
BfCompiler_RequestFastFinish(mNativeBfCompiler);
}
@ -710,6 +723,21 @@ namespace IDE.Compiler
return BfCompiler_GetCurConstEvalExecuteId(mNativeBfCompiler);
}
public void GetGeneratorTypeDefList(String outStr)
{
outStr.Append(BfCompiler_GetGeneratorTypeDefList(mNativeBfCompiler));
}
public void GetGeneratorInitData(String typeDefName, String args, String outStr)
{
outStr.Append(BfCompiler_GetGeneratorInitData(mNativeBfCompiler, typeDefName, args));
}
public void GetGeneratorGenData(String typeDefName, String args, String outStr)
{
outStr.Append(BfCompiler_GetGeneratorGenData(mNativeBfCompiler, typeDefName, args));
}
public void GetTypeDefList(String outStr)
{
outStr.Append(BfCompiler_GetTypeDefList(mNativeBfCompiler));