MCPcopy Create free account
hub / github.com/ZDoom/gzdoom / ParseScripts

Function ParseScripts

src/scripting/thingdef.cpp:420–446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

418void SetDoomCompileEnvironment();
419
420void 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
448void LoadActors()
449{

Callers 1

LoadActorsFunction · 0.85

Calls 7

ParseOneScriptFunction · 0.85
I_ErrorFunction · 0.85
PrintfFunction · 0.85
FindLumpMethod · 0.80
c_strMethod · 0.80
GetFileFullPathMethod · 0.80
CompileMethod · 0.45

Tested by

no test coverage detected