mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Replace mwscript program serialization into a vector with simple struct
Mostly to avoid string literal lookup by index with iteration over all preciding literals and calling strlen. This is very inefficient. In genral this makes code much more straightforward but also makes it portable since now int and float of different sizes are properly supported.
This commit is contained in:
parent
60eede6a1d
commit
b88f0d2dbd
21 changed files with 93 additions and 162 deletions
|
@ -23,8 +23,7 @@ namespace Compiler
|
|||
/// \param end of script is marked by end keyword.
|
||||
ScriptParser(ErrorHandler& errorHandler, const Context& context, Locals& locals, bool end = false);
|
||||
|
||||
void getCode(std::vector<Interpreter::Type_Code>& code) const;
|
||||
///< store generated code in \a code.
|
||||
Interpreter::Program getProgram() const;
|
||||
|
||||
bool parseName(const std::string& name, const TokenLoc& loc, Scanner& scanner) override;
|
||||
///< Handle a name token.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue