Already better than CSS because I can center stuff.

This commit is contained in:
Zed A. Shaw 2025-02-15 12:13:58 -05:00
parent 1620a5420f
commit 60ed686eb0
6 changed files with 58 additions and 42 deletions

View file

@ -7,7 +7,7 @@
namespace lel {
#line 36 "lel_parser.rl"
#line 38 "lel_parser.rl"
@ -15,33 +15,34 @@ namespace lel {
static const char _Parser_actions[] = {
0, 1, 1, 1, 2, 1, 3, 1,
4, 1, 5, 1, 6, 1, 9, 1,
10, 1, 11, 2, 0, 7, 2, 0,
8, 2, 4, 1, 2, 4, 5
10, 1, 11, 1, 12, 2, 0, 7,
2, 0, 8, 2, 4, 1, 2, 4,
5
};
static const char _Parser_key_offsets[] = {
0, 0, 4, 18, 20, 24, 35, 47,
52, 54, 57
0, 0, 4, 19, 21, 25, 37, 49,
54, 56, 59
};
static const char _Parser_trans_keys[] = {
32, 91, 9, 13, 32, 40, 42, 46,
60, 62, 94, 95, 9, 13, 65, 90,
97, 122, 48, 57, 41, 44, 48, 57,
40, 42, 46, 60, 62, 94, 95, 65,
90, 97, 122, 32, 93, 95, 124, 9,
13, 48, 57, 65, 90, 97, 122, 32,
93, 124, 9, 13, 48, 57, 41, 48,
57, 32, 91, 9, 13, 0
61, 94, 95, 9, 13, 60, 62, 65,
90, 97, 122, 48, 57, 41, 44, 48,
57, 40, 42, 46, 61, 94, 95, 60,
62, 65, 90, 97, 122, 32, 93, 95,
124, 9, 13, 48, 57, 65, 90, 97,
122, 32, 93, 124, 9, 13, 48, 57,
41, 48, 57, 32, 91, 9, 13, 0
};
static const char _Parser_single_lengths[] = {
0, 2, 8, 0, 2, 7, 4, 3,
0, 2, 7, 0, 2, 6, 4, 3,
0, 1, 2
};
static const char _Parser_range_lengths[] = {
0, 1, 3, 1, 1, 2, 4, 1,
0, 1, 4, 1, 1, 3, 4, 1,
1, 1, 1
};
@ -52,24 +53,26 @@ static const char _Parser_index_offsets[] = {
static const char _Parser_indicies[] = {
0, 2, 0, 1, 3, 4, 5, 6,
7, 7, 6, 8, 3, 8, 8, 1,
9, 1, 10, 11, 12, 1, 4, 5,
6, 7, 7, 6, 8, 8, 8, 1,
13, 15, 14, 16, 13, 14, 14, 14,
1, 17, 18, 19, 17, 1, 20, 1,
21, 22, 1, 23, 2, 23, 1, 0
8, 6, 9, 3, 7, 9, 9, 1,
10, 1, 11, 12, 13, 1, 4, 5,
6, 8, 6, 9, 7, 9, 9, 1,
14, 16, 15, 17, 14, 15, 15, 15,
1, 18, 19, 20, 18, 1, 21, 1,
22, 23, 1, 24, 2, 24, 1, 0
};
static const char _Parser_trans_targs[] = {
1, 0, 2, 2, 3, 5, 5, 5,
6, 4, 5, 8, 4, 7, 6, 10,
2, 7, 10, 2, 9, 5, 9, 10
5, 6, 4, 5, 8, 4, 7, 6,
10, 2, 7, 10, 2, 9, 5, 9,
10
};
static const char _Parser_trans_actions[] = {
0, 0, 3, 0, 0, 13, 5, 11,
17, 15, 19, 19, 0, 7, 0, 28,
25, 0, 9, 1, 15, 22, 0, 0
15, 19, 17, 21, 21, 0, 7, 0,
30, 27, 0, 9, 1, 17, 24, 0,
0
};
static const int Parser_start = 1;
@ -79,7 +82,7 @@ static const int Parser_error = 0;
static const int Parser_en_main = 1;
#line 39 "lel_parser.rl"
#line 41 "lel_parser.rl"
bool Parser::parse(std::string input) {
reset();
@ -91,14 +94,14 @@ bool Parser::parse(std::string input) {
std::string tk;
#line 86 "lel_parser.cpp"
#line 89 "lel_parser.cpp"
{
cs = Parser_start;
}
#line 50 "lel_parser.rl"
#line 52 "lel_parser.rl"
#line 89 "lel_parser.cpp"
#line 92 "lel_parser.cpp"
{
int _klen;
unsigned int _trans;
@ -213,14 +216,18 @@ _match:
{ expand(); }
break;
case 10:
#line 29 "lel_parser.rl"
{ start = p; }
#line 22 "lel_parser.rl"
{ center(); }
break;
case 11:
#line 32 "lel_parser.rl"
#line 31 "lel_parser.rl"
{ start = p; }
break;
case 12:
#line 34 "lel_parser.rl"
{start = p;}
break;
#line 198 "lel_parser.cpp"
#line 204 "lel_parser.cpp"
}
}
@ -233,7 +240,7 @@ _again:
_out: {}
}
#line 51 "lel_parser.rl"
#line 53 "lel_parser.rl"
bool good = pe - p == 0;
if(good) {