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

Method BeginCompilation

neo/game/script/Script_Program.cpp:1649–1680  ·  view source on GitHub ↗

============== idProgram::BeginCompilation called before compiling a batch of files, clears the pr struct ============== */

Source from the content-addressed store, hash-verified

1647==============
1648*/
1649void idProgram::BeginCompilation( void ) {
1650 statement_t *statement;
1651
1652 FreeData();
1653
1654 try {
1655 // make the first statement a return for a "NULL" function
1656 statement = AllocStatement();
1657 statement->linenumber = 0;
1658 statement->file = 0;
1659 statement->op = OP_RETURN;
1660 statement->a = NULL;
1661 statement->b = NULL;
1662 statement->c = NULL;
1663
1664 // define NULL
1665 //AllocDef( &type_void, "<NULL>", &def_namespace, true );
1666
1667 // define the return def
1668 returnDef = AllocDef( &type_vector, "<RETURN>", &def_namespace, false );
1669
1670 // define the return def for strings
1671 returnStringDef = AllocDef( &type_string, "<RETURN>", &def_namespace, false );
1672
1673 // define the sys object
1674 sysDef = AllocDef( &type_void, "sys", &def_namespace, true );
1675 }
1676
1677 catch( idCompileError &err ) {
1678 gameLocal.Error( "%s", err.error );
1679 }
1680}
1681
1682/*
1683==============

Callers

nothing calls this directly

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected