MCPcopy Create free account
hub / github.com/anjo76/angelscript / CompileScript

Function CompileScript

sdk/samples/asbuild/source/main.cpp:196–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196int CompileScript(asIScriptEngine *engine, const char *scriptFile)
197{
198 int r;
199
200 CScriptBuilder builder;
201 r = builder.StartNewModule(engine, "build");
202 if( r < 0 ) return -1;
203
204 r = builder.AddSectionFromFile(scriptFile);
205 if( r < 0 ) return -1;
206
207 r = builder.BuildModule();
208 if( r < 0 )
209 {
210 engine->WriteMessage(scriptFile, 0, 0, asMSGTYPE_ERROR, "Script failed to build");
211 return -1;
212 }
213
214 engine->WriteMessage(scriptFile, 0, 0, asMSGTYPE_INFORMATION, "Script successfully built");
215
216 return 0;
217}
218
219class CBytecodeStream : public asIBinaryStream
220{

Callers 1

mainFunction · 0.70

Calls 4

StartNewModuleMethod · 0.80
AddSectionFromFileMethod · 0.80
BuildModuleMethod · 0.80
WriteMessageMethod · 0.80

Tested by

no test coverage detected