MCPcopy Create free account
hub / github.com/covscript/covscript / run

Method run

sources/instance/instance.cpp:425–451  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

423 }
424
425 void repl::run(const string &code)
426 {
427 if (code.empty())
428 return;
429 std::deque<char> buff;
430 for (auto &ch : code)
431 buff.push_back(ch);
432 try {
433 std::deque<std::deque<token_base *>> ast;
434 context->compiler->clear_metadata();
435 context->compiler->build_line(buff, ast, 1, encoding);
436 for (auto &line : ast)
437 interpret(code, line);
438 }
439 catch (const lang_error &le) {
440 reset_status();
441 throw fatal_error(std::string("Uncaught exception: ") + le.what());
442 }
443 catch (const cs::exception &e) {
444 reset_status();
445 throw e;
446 }
447 catch (const std::exception &e) {
448 reset_status();
449 throw exception(line_num, context->file_path, code, e.what());
450 }
451 }
452
453 void repl::exec(const string &code)
454 {

Callers 9

execMethod · 0.95
call_rrMethod · 0.45
call_vvMethod · 0.45
operator()Method · 0.45
run_implMethod · 0.45
foreach_helperFunction · 0.45
interpretMethod · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 7

reset_statusFunction · 0.85
fatal_errorClass · 0.85
clear_metadataMethod · 0.80
build_lineMethod · 0.80
exceptionFunction · 0.70
emptyMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected