MayaFlux 0.1.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 188 of file ClangInterpreter.cpp.

189{
190 EvalResult result;
191
192 if (!std::filesystem::exists(filepath)) {
193 result.error = "File does not exist: " + filepath;
194 LILA_ERROR(Emitter::INTERPRETER, result.error);
195 return result;
196 }
197
198 LILA_INFO(Emitter::INTERPRETER, std::string("Evaluating file: ") + filepath);
199
200 std::string code = "#include \"" + filepath + "\"\n";
201 return eval(code);
202}
#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: