MayaFlux 0.2.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 217 of file ClangInterpreter.cpp.

218{
219 EvalResult result;
220
221 if (!std::filesystem::exists(filepath)) {
222 result.error = "File does not exist: " + filepath;
223 LILA_ERROR(Emitter::INTERPRETER, result.error);
224 return result;
225 }
226
227 LILA_INFO(Emitter::INTERPRETER, std::string("Evaluating file: ") + filepath);
228
229 std::string code = "#include \"" + filepath + "\"\n";
230 return eval(code);
231}
#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: