|
|
@ -63,10 +63,10 @@ static const char _foo_trans_targs[] = { |
|
|
|
|
|
|
|
|
|
|
|
static const char _foo_trans_actions[] = { |
|
|
|
static const char _foo_trans_actions[] = { |
|
|
|
0, 7, 0, 0, 9, 9, 0, 0,
|
|
|
|
0, 7, 0, 0, 9, 9, 0, 0,
|
|
|
|
0, 0, 0, 0, 5, 0, 0, 0,
|
|
|
|
0, 0, 0, 0, 3, 0, 0, 0,
|
|
|
|
1, 0, 13, 0, 0, 1, 0, 16,
|
|
|
|
1, 0, 13, 0, 0, 1, 0, 16,
|
|
|
|
0, 0, 1, 0, 22, 0, 0, 0,
|
|
|
|
0, 0, 1, 0, 22, 0, 0, 0,
|
|
|
|
0, 0, 0, 0, 0, 0, 3, 0,
|
|
|
|
0, 0, 0, 0, 0, 0, 5, 0,
|
|
|
|
0, 7, 11, 19, 0 |
|
|
|
0, 7, 11, 19, 0 |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -88,11 +88,11 @@ static const int foo_en_main = 18; |
|
|
|
bool parse_ansi(std::string_view codes) { |
|
|
|
bool parse_ansi(std::string_view codes) { |
|
|
|
const char *start = NULL; |
|
|
|
const char *start = NULL; |
|
|
|
int cs = 0; |
|
|
|
int cs = 0; |
|
|
|
uint8_t value = 0; |
|
|
|
unsigned int value = 0; |
|
|
|
const char *p = codes.data(); |
|
|
|
const char *p = codes.data(); |
|
|
|
const char *pe = p + codes.size(); |
|
|
|
const char *pe = p + codes.size(); |
|
|
|
const char *eof = pe; |
|
|
|
const char *eof = pe; |
|
|
|
bool fgcolor = false; |
|
|
|
bool is_fg = false; |
|
|
|
sf::Color color; |
|
|
|
sf::Color color; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -198,11 +198,11 @@ _match: |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
case 3: |
|
|
|
#line 26 ".\\ansi_parser.rl" |
|
|
|
#line 26 ".\\ansi_parser.rl" |
|
|
|
{ fgcolor = false; } |
|
|
|
{ is_fg = true; } |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 4: |
|
|
|
case 4: |
|
|
|
#line 27 ".\\ansi_parser.rl" |
|
|
|
#line 27 ".\\ansi_parser.rl" |
|
|
|
{ fgcolor = true; } |
|
|
|
{ is_fg = false; } |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 5: |
|
|
|
case 5: |
|
|
|
#line 29 ".\\ansi_parser.rl" |
|
|
|
#line 29 ".\\ansi_parser.rl" |
|
|
@ -229,7 +229,7 @@ _match: |
|
|
|
case 10: |
|
|
|
case 10: |
|
|
|
#line 39 ".\\ansi_parser.rl" |
|
|
|
#line 39 ".\\ansi_parser.rl" |
|
|
|
{ |
|
|
|
{ |
|
|
|
println("fg? {}, sf:Color: {},{},{},{}", fgcolor, color.r, color.g, color.b, color.a); |
|
|
|
println("fg? {}, sf:Color: {},{},{},{}", is_fg, color.r, color.g, color.b, color.a); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
#line 211 ".\\ansi_parser.cpp" |
|
|
|
#line 211 ".\\ansi_parser.cpp" |
|
|
@ -251,7 +251,7 @@ _again: |
|
|
|
case 10: |
|
|
|
case 10: |
|
|
|
#line 39 ".\\ansi_parser.rl" |
|
|
|
#line 39 ".\\ansi_parser.rl" |
|
|
|
{ |
|
|
|
{ |
|
|
|
println("fg? {}, sf:Color: {},{},{},{}", fgcolor, color.r, color.g, color.b, color.a); |
|
|
|
println("fg? {}, sf:Color: {},{},{},{}", is_fg, color.r, color.g, color.b, color.a); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
#line 231 ".\\ansi_parser.cpp" |
|
|
|
#line 231 ".\\ansi_parser.cpp" |
|
|
|