Rewrote the ansi parser to exactly callback on color setting, so now just need to clean this all up and fix a few little bugs.

This commit is contained in:
Zed A. Shaw 2024-11-16 12:10:14 -05:00
parent 96ee16e598
commit 89a70f398a
9 changed files with 274 additions and 126 deletions

View file

@ -63,7 +63,11 @@ TEST_CASE("test out ragel parser", "[gui]") {
std::cout << colors;
bool good = ansi.parse(colors_utf, [&](sf::Color bgcolor, sf::Color color, wchar_t ch) {
bool good = ansi.parse(colors_utf,
[&](sf::Color color, sf::Color bgcolor){
// ignore color
},
[&](wchar_t ch) {
bool correct_char = ch == '#' || ch == ' ' || ch == '\n' || ch == '\r';
REQUIRE(correct_char);
});