Bladeren bron

easymesh: make hex colour command arguments case-insensitive.

legacy
Sam Hocevar sam 12 jaren geleden
bovenliggende
commit
6cb1db5188
2 gewijzigde bestanden met toevoegingen van 43 en 43 verwijderingen
  1. +4
    -4
      src/easymesh/easymesh-scanner.l
  2. +39
    -39
      src/generated/easymesh-scanner.cpp

+ 4
- 4
src/easymesh/easymesh-scanner.l Bestand weergeven

@@ -83,25 +83,25 @@ at { return token::T_TRIANGLE; }
aq { return token::T_QUAD; }
acg { return token::T_COG; }

#[0-9a-f]{3} {
#[0-9a-fA-F]{3} {
uint32_t tmp = std::strtol(yytext + 1, NULL, 16);
yylval->u32val = 0x11000000u * (tmp >> 8)
| 0x00110000u * ((tmp >> 4) & 0xf)
| 0x00001100u * (tmp & 0xf)
| 0x000000ffu;
return token::COLOR; }
#[0-9a-f]{4} {
#[0-9a-fA-F]{4} {
uint32_t tmp = std::strtol(yytext + 1, NULL, 16);
yylval->u32val = 0x11000000u * (tmp >> 12)
| 0x00110000u * ((tmp >> 8) & 0xf)
| 0x00001100u * ((tmp >> 4) & 0xf)
| 0x00000011u * (tmp & 0xf);
return token::COLOR; }
#[0-9a-f]{6} {
#[0-9a-fA-F]{6} {
yylval->u32val = 0xffu
| 0x100u * (uint32_t)std::strtol(yytext + 1, NULL, 16);
return token::COLOR; }
#[0-9a-f]{8} {
#[0-9a-fA-F]{8} {
yylval->u32val = (uint32_t)std::strtol(yytext + 1, NULL, 16);
return token::COLOR; }
[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)? {


+ 39
- 39
src/generated/easymesh-scanner.cpp Bestand weergeven

@@ -359,14 +359,14 @@ static yyconst flex_int32_t yy_ec[256] =
1, 3, 1, 1, 4, 1, 1, 1, 1, 1,
1, 1, 5, 3, 6, 7, 1, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 9, 1,
1, 1, 1, 1, 9, 9, 9, 9, 10, 9,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
10, 1, 11, 1, 1, 1, 12, 13, 14, 15,
11, 1, 12, 1, 1, 1, 13, 14, 15, 16,

16, 17, 18, 19, 1, 1, 1, 1, 20, 1,
1, 21, 22, 23, 24, 25, 1, 1, 1, 26,
27, 28, 1, 1, 1, 1, 1, 1, 1, 1,
17, 18, 19, 20, 1, 1, 1, 1, 21, 1,
1, 22, 23, 24, 25, 26, 1, 1, 1, 27,
28, 29, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -383,23 +383,23 @@ static yyconst flex_int32_t yy_ec[256] =
1, 1, 1, 1, 1
} ;

static yyconst flex_int32_t yy_meta[29] =
static yyconst flex_int32_t yy_meta[30] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 2, 1, 1,
1, 2, 2, 2, 2, 2, 2, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1
1, 1, 1, 1, 1, 1, 1, 2, 2, 2,
1, 1, 2, 2, 2, 2, 2, 2, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1
} ;

static yyconst flex_int16_t yy_base[80] =
{ 0,
0, 0, 96, 97, 97, 97, 0, 22, 24, 87,
26, 97, 97, 30, 75, 10, 13, 34, 37, 0,
85, 50, 59, 45, 97, 58, 97, 68, 77, 97,
57, 97, 97, 97, 97, 97, 97, 97, 97, 77,
97, 97, 97, 46, 97, 97, 97, 0, 81, 80,
66, 97, 97, 73, 72, 65, 97, 97, 97, 97,
0, 97, 97, 97, 97, 0, 0, 0, 0, 97,
97, 81, 80, 79, 78, 77, 75, 67, 54
0, 0, 97, 98, 98, 98, 0, 23, 25, 88,
27, 98, 98, 31, 75, 11, 14, 35, 38, 0,
86, 51, 61, 47, 98, 57, 98, 68, 77, 98,
57, 98, 98, 98, 98, 98, 98, 98, 98, 77,
98, 98, 98, 46, 98, 98, 98, 0, 82, 81,
66, 98, 98, 73, 72, 65, 98, 98, 98, 98,
0, 98, 98, 98, 98, 0, 0, 0, 0, 98,
98, 82, 81, 80, 79, 78, 75, 58, 34
} ;

static yyconst flex_int16_t yy_def[80] =
@@ -414,40 +414,40 @@ static yyconst flex_int16_t yy_def[80] =
0, 71, 71, 71, 71, 71, 71, 71, 71
} ;

static yyconst flex_int16_t yy_nxt[126] =
static yyconst flex_int16_t yy_nxt[128] =
{ 0,
4, 5, 6, 7, 8, 9, 10, 11, 4, 12,
13, 14, 4, 15, 4, 4, 4, 4, 4, 16,
4, 4, 17, 18, 19, 4, 4, 4, 21, 22,
21, 22, 21, 22, 24, 34, 35, 36, 37, 38,
39, 24, 25, 26, 27, 28, 29, 40, 44, 49,
49, 30, 50, 31, 32, 70, 21, 22, 24, 41,
42, 43, 45, 46, 47, 24, 23, 24, 69, 51,
55, 58, 59, 60, 24, 52, 68, 56, 67, 66,
61, 48, 20, 65, 64, 63, 62, 50, 50, 57,
54, 53, 23, 33, 23, 71, 3, 71, 71, 71,
4, 5, 6, 7, 8, 9, 10, 11, 4, 4,
12, 13, 14, 4, 15, 4, 4, 4, 4, 4,
16, 4, 4, 17, 18, 19, 4, 4, 4, 21,
22, 21, 22, 21, 22, 70, 24, 34, 35, 36,
37, 38, 39, 24, 25, 26, 27, 28, 29, 40,
44, 49, 49, 30, 50, 31, 32, 21, 22, 69,
24, 41, 42, 43, 45, 46, 47, 24, 23, 51,
24, 55, 58, 59, 60, 52, 68, 24, 56, 67,
66, 61, 48, 20, 65, 64, 63, 62, 50, 50,
57, 54, 53, 23, 33, 23, 71, 3, 71, 71,

71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
71, 71, 71, 71, 71
71, 71, 71, 71, 71, 71, 71
} ;

static yyconst flex_int16_t yy_chk[126] =
static yyconst flex_int16_t yy_chk[128] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 8, 8,
9, 9, 11, 11, 11, 16, 16, 16, 17, 17,
17, 11, 14, 14, 14, 14, 14, 18, 19, 24,
24, 14, 24, 14, 14, 79, 22, 22, 22, 18,
18, 18, 19, 19, 19, 22, 23, 23, 78, 26,
31, 44, 44, 44, 23, 26, 77, 31, 76, 75,
74, 73, 72, 56, 55, 54, 51, 50, 49, 40,
29, 28, 21, 15, 10, 3, 71, 71, 71, 71,
1, 1, 1, 1, 1, 1, 1, 1, 1, 8,
8, 9, 9, 11, 11, 79, 11, 16, 16, 16,
17, 17, 17, 11, 14, 14, 14, 14, 14, 18,
19, 24, 24, 14, 24, 14, 14, 22, 22, 78,
22, 18, 18, 18, 19, 19, 19, 22, 23, 26,
23, 31, 44, 44, 44, 26, 77, 23, 31, 76,
75, 74, 73, 72, 56, 55, 54, 51, 50, 49,
40, 29, 28, 21, 15, 10, 3, 71, 71, 71,

71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
71, 71, 71, 71, 71
71, 71, 71, 71, 71, 71, 71
} ;

/* The intent behind this definition is that it'll catch


Laden…
Annuleren
Opslaan