MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / ParseLocal

Method ParseLocal

neo/framework/DeclManager.cpp:2177–2217  ·  view source on GitHub ↗

================= idDeclLocal::ParseLocal ================= */

Source from the content-addressed store, hash-verified

2175=================
2176*/
2177void idDeclLocal::ParseLocal( void ) {
2178 bool generatedDefaultText = false;
2179
2180 AllocateSelf();
2181
2182 // always free data before parsing
2183 self->FreeData();
2184
2185 declManagerLocal.MediaPrint( "parsing %s %s\n", declManagerLocal.declTypes[type]->typeName.c_str(), name.c_str() );
2186
2187 // if no text source try to generate default text
2188 if ( textSource == NULL ) {
2189 generatedDefaultText = self->SetDefaultText();
2190 }
2191
2192 // indent for DEFAULTED or media file references
2193 declManagerLocal.indent++;
2194
2195 // no text immediately causes a MakeDefault()
2196 if ( textSource == NULL ) {
2197 MakeDefault();
2198 declManagerLocal.indent--;
2199 return;
2200 }
2201
2202 declState = DS_PARSED;
2203
2204 // parse
2205 char *declText = (char *) _alloca( ( GetTextLength() + 1 ) * sizeof( char ) );
2206 GetText( declText );
2207 self->Parse( declText, GetTextLength() );
2208
2209 // free generated text
2210 if ( generatedDefaultText ) {
2211 Mem_Free( textSource );
2212 textSource = 0;
2213 textLength = 0;
2214 }
2215
2216 declManagerLocal.indent--;
2217}
2218
2219/*
2220=================

Callers 4

LoadAndParseMethod · 0.80
FindTypeMethod · 0.80
DeclByIndexMethod · 0.80
CreateNewDeclMethod · 0.80

Calls 6

FreeDataMethod · 0.95
SetDefaultTextMethod · 0.95
ParseMethod · 0.95
Mem_FreeFunction · 0.85
MediaPrintMethod · 0.80
c_strMethod · 0.45

Tested by

no test coverage detected