goalc/repl: cleanup of goalc/REPL code and some QoL improvements (#2104)

- lets you split up your `startup.gc` file into two sections
  - one that runs on initial startup / reloads
  - the other that runs when you listen to a target
- allows for customization of the keybinds added a month or so ago
- removes a useless flag (--startup-cmd) and marks others for
deprecation.
- added another help prompt that lists all the keybinds and what they do

Co-authored-by: water <awaterford111445@gmail.com>
This commit is contained in:
Tyler Wilding
2023-01-07 11:24:02 -05:00
committed by GitHub
parent 2f4146d469
commit 00ac12094e
35 changed files with 555 additions and 254 deletions
+2 -3
View File
@@ -1,6 +1,5 @@
#include "execution.h"
#include "common/util/diff.h"
#include "common/util/string_util.h"
#include "goalc/compiler/Compiler.h"
@@ -36,7 +35,7 @@ void decompile(OfflineTestDecompiler& dc,
std::string clean_decompilation_code(const std::string& in, const bool leave_comments = false) {
std::string out = in;
if (!leave_comments) {
std::vector<std::string> lines = split_string(in);
std::vector<std::string> lines = str_util::split(in);
// Remove all lines that are comments
// comments are added only by us, meaning this _should_ be consistent
std::vector<std::string>::iterator line_itr = lines.begin();
@@ -82,7 +81,7 @@ OfflineTestCompareResult compare(OfflineTestDecompiler& dc,
compare_result.total_files++;
compare_result.total_lines += str_util::line_count(result);
if (result != ref) {
compare_result.failing_files.push_back({file.unique_name, diff_strings(ref, result)});
compare_result.failing_files.push_back({file.unique_name, str_util::diff(ref, result)});
compare_result.total_pass = false;
if (config.dump_mode) {
auto failure_dir = file_util::get_jak_project_dir() / "failures";