Mostly working now, just had to manually calculate the grid. Needs a cleanup but I'm moving on for now.

This commit is contained in:
Zed A. Shaw 2024-11-17 12:37:07 -05:00
parent 89a70f398a
commit 34c84343db
4 changed files with 65 additions and 56 deletions

View file

@ -10,7 +10,7 @@
using namespace fmt;
#line 105 "ansi_parser.rl"
#line 107 "ansi_parser.rl"
@ -96,7 +96,7 @@ static const int foo_error = 0;
static const int foo_en_main = 23;
#line 108 "ansi_parser.rl"
#line 110 "ansi_parser.rl"
#include <ftxui/screen/terminal.hpp>
@ -127,7 +127,7 @@ bool ANSIParser::parse(std::wstring_view codes, ColorCB color_cb, WriteCB write_
cs = foo_start;
}
#line 133 "ansi_parser.rl"
#line 135 "ansi_parser.rl"
#line 120 "ansi_parser.cpp"
{
@ -267,8 +267,8 @@ _match:
case 8:
#line 56 "ansi_parser.rl"
{
color = {100,100,100}; // UNDO THIS
bgcolor = $default_bg; // THIS TOO
color = $default_bg;
bgcolor = $default_fg;
color_cb(color, bgcolor);
}
break;
@ -283,29 +283,31 @@ _match:
case 10:
#line 66 "ansi_parser.rl"
{
color = sf::Color(100,100,100);
color_cb(color, bgcolor);
}
break;
case 11:
#line 69 "ansi_parser.rl"
#line 71 "ansi_parser.rl"
{ target.r = value; }
break;
case 12:
#line 70 "ansi_parser.rl"
#line 72 "ansi_parser.rl"
{ target.g = value; }
break;
case 13:
#line 71 "ansi_parser.rl"
#line 73 "ansi_parser.rl"
{ target.b = value; }
break;
case 14:
#line 72 "ansi_parser.rl"
#line 74 "ansi_parser.rl"
{ value = 0; }
break;
case 15:
#line 73 "ansi_parser.rl"
#line 75 "ansi_parser.rl"
{}
break;
#line 279 "ansi_parser.cpp"
#line 281 "ansi_parser.cpp"
}
}
@ -322,10 +324,10 @@ _again:
while ( __nacts-- > 0 ) {
switch ( *__acts++ ) {
case 15:
#line 73 "ansi_parser.rl"
#line 75 "ansi_parser.rl"
{}
break;
#line 297 "ansi_parser.cpp"
#line 299 "ansi_parser.cpp"
}
}
}
@ -333,7 +335,7 @@ _again:
_out: {}
}
#line 134 "ansi_parser.rl"
#line 136 "ansi_parser.rl"
bool good = p - pe == 0;