|
|
|
@ -10,7 +10,7 @@ |
|
|
|
|
using namespace fmt; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#line 107 "ansi_parser.rl" |
|
|
|
|
#line 110 "ansi_parser.rl" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -24,15 +24,16 @@ static const char _foo_actions[] = { |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
static const char _foo_key_offsets[] = { |
|
|
|
|
0, 0, 1, 2, 8, 9, 11, 12,
|
|
|
|
|
15, 16, 17, 18, 20, 23, 25, 28,
|
|
|
|
|
30, 33, 34, 37, 38, 39, 40, 41,
|
|
|
|
|
42 |
|
|
|
|
0, 0, 1, 2, 10, 11, 13, 16,
|
|
|
|
|
19, 20, 23, 24, 25, 26, 28, 31,
|
|
|
|
|
33, 36, 38, 41, 42, 45, 46, 47,
|
|
|
|
|
48, 49, 50 |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
static const int _foo_trans_keys[] = { |
|
|
|
|
27, 91, 50, 51, 52, 55, 48, 54,
|
|
|
|
|
109, 55, 109, 109, 56, 57, 109, 59,
|
|
|
|
|
27, 91, 49, 50, 51, 52, 55, 57,
|
|
|
|
|
48, 54, 109, 48, 109, 34, 48, 55,
|
|
|
|
|
50, 55, 109, 109, 56, 57, 109, 59,
|
|
|
|
|
50, 59, 48, 57, 59, 48, 57, 48,
|
|
|
|
|
57, 59, 48, 57, 48, 57, 109, 48,
|
|
|
|
|
57, 109, 56, 57, 109, 59, 50, 109,
|
|
|
|
@ -40,63 +41,65 @@ static const int _foo_trans_keys[] = { |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
static const char _foo_single_lengths[] = { |
|
|
|
|
0, 1, 1, 4, 1, 2, 1, 3,
|
|
|
|
|
1, 1, 1, 0, 1, 0, 1, 0,
|
|
|
|
|
1, 1, 3, 1, 1, 1, 1, 1,
|
|
|
|
|
1 |
|
|
|
|
0, 1, 1, 6, 1, 2, 3, 3,
|
|
|
|
|
1, 3, 1, 1, 1, 0, 1, 0,
|
|
|
|
|
1, 0, 1, 1, 3, 1, 1, 1,
|
|
|
|
|
1, 1, 1 |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
static const char _foo_range_lengths[] = { |
|
|
|
|
0, 0, 0, 1, 0, 0, 0, 0,
|
|
|
|
|
0, 0, 0, 1, 1, 1, 1, 1,
|
|
|
|
|
1, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
|
0 |
|
|
|
|
0, 0, 0, 0, 0, 1, 1, 1,
|
|
|
|
|
1, 1, 1, 0, 0, 0, 0, 0,
|
|
|
|
|
0, 0, 0 |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
static const char _foo_index_offsets[] = { |
|
|
|
|
0, 0, 2, 4, 10, 12, 15, 17,
|
|
|
|
|
21, 23, 25, 27, 29, 32, 34, 37,
|
|
|
|
|
39, 42, 44, 48, 50, 52, 54, 56,
|
|
|
|
|
58 |
|
|
|
|
0, 0, 2, 4, 12, 14, 17, 21,
|
|
|
|
|
25, 27, 31, 33, 35, 37, 39, 42,
|
|
|
|
|
44, 47, 49, 52, 54, 58, 60, 62,
|
|
|
|
|
64, 66, 68 |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
static const char _foo_trans_targs[] = { |
|
|
|
|
2, 1, 3, 0, 5, 7, 18, 22,
|
|
|
|
|
4, 0, 24, 0, 6, 24, 0, 24,
|
|
|
|
|
0, 8, 17, 24, 0, 9, 0, 10,
|
|
|
|
|
0, 11, 0, 12, 0, 13, 12, 0,
|
|
|
|
|
14, 0, 15, 14, 0, 16, 0, 24,
|
|
|
|
|
16, 0, 24, 0, 19, 21, 24, 0,
|
|
|
|
|
20, 0, 10, 0, 24, 0, 24, 0,
|
|
|
|
|
2, 1, 2, 1, 0 |
|
|
|
|
2, 1, 3, 0, 5, 7, 9, 20,
|
|
|
|
|
24, 6, 4, 0, 26, 0, 6, 26,
|
|
|
|
|
0, 4, 4, 4, 0, 4, 8, 26,
|
|
|
|
|
0, 26, 0, 10, 19, 26, 0, 11,
|
|
|
|
|
0, 12, 0, 13, 0, 14, 0, 15,
|
|
|
|
|
14, 0, 16, 0, 17, 16, 0, 18,
|
|
|
|
|
0, 26, 18, 0, 26, 0, 21, 23,
|
|
|
|
|
26, 0, 22, 0, 12, 0, 26, 0,
|
|
|
|
|
26, 0, 2, 1, 2, 1, 0 |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
static const char _foo_trans_actions[] = { |
|
|
|
|
0, 7, 0, 0, 19, 19, 19, 19,
|
|
|
|
|
19, 0, 0, 0, 0, 17, 0, 15,
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 3,
|
|
|
|
|
0, 0, 0, 1, 0, 23, 0, 0,
|
|
|
|
|
1, 0, 26, 0, 0, 1, 0, 32,
|
|
|
|
|
0, 0, 9, 0, 0, 0, 0, 0,
|
|
|
|
|
0, 0, 5, 0, 11, 0, 13, 0,
|
|
|
|
|
0, 7, 21, 29, 0 |
|
|
|
|
19, 19, 19, 0, 0, 0, 0, 0,
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 17,
|
|
|
|
|
0, 15, 0, 0, 0, 0, 0, 0,
|
|
|
|
|
0, 3, 0, 0, 0, 1, 0, 23,
|
|
|
|
|
0, 0, 1, 0, 26, 0, 0, 1,
|
|
|
|
|
0, 32, 0, 0, 9, 0, 0, 0,
|
|
|
|
|
0, 0, 0, 0, 5, 0, 11, 0,
|
|
|
|
|
13, 0, 0, 7, 21, 29, 0 |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
static const char _foo_eof_actions[] = { |
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
|
21 |
|
|
|
|
0, 0, 21 |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
static const int foo_start = 23; |
|
|
|
|
static const int foo_first_final = 23; |
|
|
|
|
static const int foo_start = 25; |
|
|
|
|
static const int foo_first_final = 25; |
|
|
|
|
static const int foo_error = 0; |
|
|
|
|
|
|
|
|
|
static const int foo_en_main = 23; |
|
|
|
|
static const int foo_en_main = 25; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#line 110 "ansi_parser.rl" |
|
|
|
|
#line 113 "ansi_parser.rl" |
|
|
|
|
|
|
|
|
|
#include <ftxui/screen/terminal.hpp> |
|
|
|
|
|
|
|
|
@ -122,14 +125,14 @@ bool ANSIParser::parse(std::wstring_view codes, ColorCB color_cb, WriteCB write_ |
|
|
|
|
sf::Color &target = color; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#line 117 "ansi_parser.cpp" |
|
|
|
|
#line 120 "ansi_parser.cpp" |
|
|
|
|
{ |
|
|
|
|
cs = foo_start; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#line 135 "ansi_parser.rl" |
|
|
|
|
#line 138 "ansi_parser.rl" |
|
|
|
|
|
|
|
|
|
#line 120 "ansi_parser.cpp" |
|
|
|
|
#line 123 "ansi_parser.cpp" |
|
|
|
|
{ |
|
|
|
|
int _klen; |
|
|
|
|
unsigned int _trans; |
|
|
|
@ -307,7 +310,7 @@ _match: |
|
|
|
|
#line 75 "ansi_parser.rl" |
|
|
|
|
{} |
|
|
|
|
break; |
|
|
|
|
#line 281 "ansi_parser.cpp" |
|
|
|
|
#line 284 "ansi_parser.cpp" |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -327,7 +330,7 @@ _again: |
|
|
|
|
#line 75 "ansi_parser.rl" |
|
|
|
|
{} |
|
|
|
|
break; |
|
|
|
|
#line 299 "ansi_parser.cpp" |
|
|
|
|
#line 302 "ansi_parser.cpp" |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -335,12 +338,13 @@ _again: |
|
|
|
|
_out: {} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#line 136 "ansi_parser.rl" |
|
|
|
|
#line 139 "ansi_parser.rl" |
|
|
|
|
|
|
|
|
|
bool good = p - pe == 0; |
|
|
|
|
|
|
|
|
|
if(!good) { |
|
|
|
|
println("FAIL AT {}", p - pe); |
|
|
|
|
p -= 10; |
|
|
|
|
// dear cthuhlu, save me from the pain that is wstring
|
|
|
|
|
for(int i = 0; i < 100; i++) { |
|
|
|
|
print("{}", char(p[i])); |
|
|
|
|