| 49 | void SetRazeCompileEnvironment(); |
| 50 | |
| 51 | void ParseScripts() |
| 52 | { |
| 53 | int lump, lastlump = 0; |
| 54 | FScriptPosition::ResetErrorCounter(); |
| 55 | |
| 56 | while ((lump = fileSystem.FindLump("ZSCRIPT", &lastlump)) != -1) |
| 57 | { |
| 58 | ZCCParseState state; |
| 59 | auto newns = ParseOneScript(lump, state); |
| 60 | PSymbolTable symtable; |
| 61 | |
| 62 | ZCCRazeCompiler cc(state, NULL, symtable, newns, lump, state.ParseVersion); |
| 63 | cc.Compile(); |
| 64 | |
| 65 | if (FScriptPosition::ErrorCounter > 0) |
| 66 | { |
| 67 | // Abort if the compiler produced any errors. Also do not compile further lumps, because they very likely miss some stuff. |
| 68 | I_Error("%d errors, %d warnings while compiling %s", FScriptPosition::ErrorCounter, FScriptPosition::WarnCounter, fileSystem.GetFileFullPath(lump).c_str()); |
| 69 | } |
| 70 | else if (FScriptPosition::WarnCounter > 0) |
| 71 | { |
| 72 | // If we got warnings, but no errors, print the information but continue. |
| 73 | Printf(TEXTCOLOR_ORANGE "%d warnings while compiling %s\n", FScriptPosition::WarnCounter, fileSystem.GetFileFullPath(lump).c_str()); |
| 74 | } |
| 75 | |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | void InitServices(); |
| 80 |
no test coverage detected