MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ eval_file()

ClangInterpreter::EvalResult Lila::ClangInterpreter::eval_file ( const std::string &  filepath)

Evaluates a code file by including it.

Parameters
filepathPath to the file to execute
Returns
EvalResult containing success, output, and error info

Definition at line 304 of file ClangInterpreter.cpp.

305{
306 EvalResult result;
307
308 if (!std::filesystem::exists(filepath)) {
309 result.error = "File does not exist: " + filepath;
310 LILA_ERROR(Emitter::INTERPRETER, result.error);
311 return result;
312 }
313
314 LILA_INFO(Emitter::INTERPRETER, std::string("Evaluating file: ") + filepath);
315
316 std::string code = "#include \"" + filepath + "\"\n";
317 return eval(code);
318}
#define LILA_ERROR(emitter, msg)
#define LILA_INFO(emitter, msg)
EvalResult eval(const std::string &code)
Evaluates a code snippet.

References Lila::ClangInterpreter::EvalResult::error, eval(), LILA_ERROR, and LILA_INFO.

+ Here is the call graph for this function: