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

Function ParseScripts

source/core/zcompile.cpp:51–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49void SetRazeCompileEnvironment();
50
51void 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
79void InitServices();
80

Callers 1

LoadScriptsFunction · 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