| 194 | } |
| 195 | |
| 196 | int 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 | |
| 219 | class CBytecodeStream : public asIBinaryStream |
| 220 | { |
no test coverage detected