| 418 | void SetDoomCompileEnvironment(); |
| 419 | |
| 420 | void ParseScripts() |
| 421 | { |
| 422 | int lump, lastlump = 0; |
| 423 | FScriptPosition::ResetErrorCounter(); |
| 424 | |
| 425 | while ((lump = fileSystem.FindLump("ZSCRIPT", &lastlump)) != -1) |
| 426 | { |
| 427 | ZCCParseState state; |
| 428 | auto newns = ParseOneScript(lump, state); |
| 429 | PSymbolTable symtable; |
| 430 | |
| 431 | ZCCDoomCompiler cc(state, NULL, symtable, newns, lump, state.ParseVersion); |
| 432 | cc.Compile(); |
| 433 | |
| 434 | if (FScriptPosition::ErrorCounter > 0) |
| 435 | { |
| 436 | // Abort if the compiler produced any errors. Also do not compile further lumps, because they very likely miss some stuff. |
| 437 | I_Error("%d errors, %d warnings while compiling %s", FScriptPosition::ErrorCounter, FScriptPosition::WarnCounter, fileSystem.GetFileFullPath(lump).c_str()); |
| 438 | } |
| 439 | else if (FScriptPosition::WarnCounter > 0) |
| 440 | { |
| 441 | // If we got warnings, but no errors, print the information but continue. |
| 442 | Printf(TEXTCOLOR_ORANGE "%d warnings while compiling %s\n", FScriptPosition::WarnCounter, fileSystem.GetFileFullPath(lump).c_str()); |
| 443 | } |
| 444 | |
| 445 | } |
| 446 | } |
| 447 | |
| 448 | void LoadActors() |
| 449 | { |
no test coverage detected