MCPcopy Create free account
hub / github.com/LibreCAD/LibreCAD / SetByteCode

Method SetByteCode

libraries/muparser/src/muParserBase.cpp:283–298  ·  view source on GitHub ↗

\brief Restore a previously saved bytecode. */

Source from the content-addressed store, hash-verified

281
282 /** \brief Restore a previously saved bytecode. */
283 void ParserBase::SetByteCode(const ParserByteCode& a_ByteCode)
284 {
285 // If a variable factory is defined the bytecode may contain references to dynamically
286 // created variables.
287// if (m_pTokenReader->HasVarCreator())
288// Error(ecBYTECODE_IMPORT_EXPORT_DISABLED);
289
290 m_vRPN = a_ByteCode;
291
292 // restore expression environment
293 string_type expr;
294 std::tie(expr, m_vStringBuf) = a_ByteCode.RestoreEnvironment();
295 m_pTokenReader->SetFormula(expr);
296
297 m_pParseFormula = &ParserBase::ParseCmdCode;
298 }
299
300
301 /** \brief Returns the version of muparser.

Callers

nothing calls this directly

Calls 1

SetFormulaMethod · 0.45

Tested by

no test coverage detected