mirror of
https://github.com/open-goal/jak-project.git
synced 2024-11-24 06:39:51 +00:00
8bba3d7fd7
* swap to replxx from linenoise * repl: Implement form auto-tab-completion * repl: color coordinate the prompts * repl: Add some basic syntax highlighting, bracket pairs and forms (all one color) * repl: A more consistent starting screen for the repl * repl: bug fix for auto-complete * debug linux * linting
34 lines
802 B
C++
34 lines
802 B
C++
#pragma once
|
|
|
|
#include <functional>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "third-party/replxx/include/replxx.hxx"
|
|
|
|
using Replxx = replxx::Replxx;
|
|
|
|
class ReplWrapper {
|
|
Replxx repl;
|
|
|
|
public:
|
|
ReplWrapper() {}
|
|
Replxx& get_repl() { return repl; }
|
|
void init_default_settings();
|
|
|
|
// Functionality / Commands
|
|
void clear_screen();
|
|
void print_welcome_message();
|
|
void set_history_max_size(size_t len);
|
|
const char* readline(const std::string& prompt);
|
|
void add_to_history(const std::string& line);
|
|
void save_history();
|
|
void load_history();
|
|
void print_help_message();
|
|
std::pair<std::string, bool> get_current_repl_token(std::string const& context);
|
|
|
|
std::vector<std::string> examples{};
|
|
using cl = Replxx::Color;
|
|
std::vector<std::pair<std::string, cl>> regex_colors{};
|
|
};
|