6 #define CADABRA_CLI_DEBUG_MARKER
10 #include <pybind11/pybind11.h>
11 #include <pybind11/embed.h>
12 #ifdef CADABRA_CLI_DEBUG_MARKER
14 #undef CADABRA_CLI_DEBUG_MARKER
34 pybind11::object
evaluate(
const std::string& code,
const std::string& filename =
"<stdin>");
35 void execute(
const std::string& code,
const std::string& filename =
"<stdin>");
36 void execute_file(
const std::string& filename,
bool preprocess =
true);
37 void interact_file(
const std::string& filename,
bool preprocess =
true);
47 std::string
str(
const pybind11::handle& obj);
48 std::string
repr(
const pybind11::handle& obj);
81 virtual const char*
what()
const noexcept
override;
Shell::Flags & operator|=(Shell::Flags &lhs, Shell::Flags rhs)
Definition: cadabra2-cli.cc:561
bool operator&(Shell::Flags lhs, Shell::Flags rhs)
Definition: cadabra2-cli.cc:574
Shell::Flags operator|(Shell::Flags lhs, Shell::Flags rhs)
Definition: cadabra2-cli.cc:569
Definition: cadabra2-cli.hh:75
virtual const char * what() const noexcept override
Definition: cadabra2-cli.cc:556
ExitRequest()
Definition: cadabra2-cli.cc:547
std::string message
Definition: cadabra2-cli.hh:84
int code
Definition: cadabra2-cli.hh:83
Definition: cadabra2-cli.hh:18
std::string str(const pybind11::handle &obj)
Definition: cadabra2-cli.cc:377
void interact()
Definition: cadabra2-cli.cc:131
std::string site_path
Definition: cadabra2-cli.hh:45
void restart()
Definition: cadabra2-cli.cc:99
void process_ps2(const std::string &line)
Definition: cadabra2-cli.cc:458
std::string sanitize(std::string s)
Definition: cadabra2-cli.cc:392
Flags flags
Definition: cadabra2-cli.hh:71
void set_completion_callback(const char *buffer, std::vector< std::string > &completions)
Definition: cadabra2-cli.cc:471
pybind11::object py_stderr
Definition: cadabra2-cli.hh:63
pybind11::object evaluate(const std::string &code, const std::string &filename="<stdin>")
Definition: cadabra2-cli.cc:203
std::string collect
Definition: cadabra2-cli.hh:64
const char * colour_reset
Definition: cadabra2-cli.hh:70
const char * colour_info
Definition: cadabra2-cli.hh:68
pybind11::object sys
Definition: cadabra2-cli.hh:62
void interact_file(const std::string &filename, bool preprocess=true)
Definition: cadabra2-cli.cc:256
std::string get_ps2()
Definition: cadabra2-cli.cc:499
std::string repr(const pybind11::handle &obj)
Definition: cadabra2-cli.cc:382
void set_histfile()
Definition: cadabra2-cli.cc:342
~Shell()
Definition: cadabra2-cli.cc:93
Flags
Definition: cadabra2-cli.hh:21
const char * colour_warning
Definition: cadabra2-cli.hh:67
void handle_error()
Definition: cadabra2-cli.cc:507
void write_stderr(const std::string &text, const std::string &end="\n", bool flush=false)
Definition: cadabra2-cli.cc:330
std::string histfile
Definition: cadabra2-cli.hh:44
void execute_file(const std::string &filename, bool preprocess=true)
Definition: cadabra2-cli.cc:228
const char * colour_success
Definition: cadabra2-cli.hh:69
pybind11::object py_stdout
Definition: cadabra2-cli.hh:63
void execute(const std::string &code, const std::string &filename="<stdin>")
Definition: cadabra2-cli.cc:216
const char * colour_error
Definition: cadabra2-cli.hh:66
void write_stdout(const std::string &text, const std::string &end="\n", bool flush=false)
Definition: cadabra2-cli.cc:318
pybind11::dict globals
Definition: cadabra2-cli.hh:61
std::string get_ps1()
Definition: cadabra2-cli.cc:491
void process_ps1(const std::string &line)
Definition: cadabra2-cli.cc:398
void handle_error(pybind11::error_already_set &err)
Shell(Flags flags)
Definition: cadabra2-cli.cc:73
Ex rhs(Ex_ptr ex)
Definition: py_ex.cc:391
Ex lhs(Ex_ptr ex)
Definition: py_ex.cc:379
end
Definition: nevaluate.py:22
Flush flush
Definition: Snoop.cc:63