BUG: When an unquoted argument contains a pair of matching double quotes spaces and tabs should be allowed in-between. This allows arguments like -DFOO='"bar zot"' to work.

This commit is contained in:
Brad King 2005-09-19 17:20:48 -04:00
parent ec36660ca8
commit dbe997e63b
2 changed files with 47 additions and 46 deletions

View File

@ -374,19 +374,19 @@ static yyconst flex_int16_t yy_accept[39] =
static yyconst flex_int32_t yy_ec[256] = static yyconst flex_int32_t yy_ec[256] =
{ 0, { 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 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, 2, 1, 4, 5, 6, 1, 1, 1, 7, 1, 2, 1, 5, 6, 7, 1, 1, 1, 8,
8, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 1, 1, 1, 1, 1, 1, 10, 10, 10,
9, 9, 9, 9, 9, 9, 9, 1, 1, 1, 10, 10, 10, 10, 10, 10, 10, 1, 1, 1,
1, 1, 1, 1, 10, 10, 10, 10, 10, 10, 1, 1, 1, 1, 11, 11, 11, 11, 11, 11,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
1, 11, 1, 1, 10, 1, 10, 10, 10, 10, 1, 12, 1, 1, 11, 1, 11, 11, 11, 11,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
10, 10, 1, 1, 1, 1, 1, 1, 1, 1, 11, 11, 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, 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,
@ -403,19 +403,19 @@ static yyconst flex_int32_t yy_ec[256] =
1, 1, 1, 1, 1 1, 1, 1, 1, 1
} ; } ;
static yyconst flex_int32_t yy_meta[12] = static yyconst flex_int32_t yy_meta[13] =
{ 0, { 0,
1, 1, 2, 3, 1, 1, 1, 4, 4, 4, 1, 1, 2, 1, 3, 1, 1, 1, 4, 4,
1 4, 1
} ; } ;
static yyconst flex_int16_t yy_base[48] = static yyconst flex_int16_t yy_base[48] =
{ 0, { 0,
0, 0, 9, 18, 34, 29, 82, 82, 82, 0, 0, 0, 10, 20, 34, 32, 89, 89, 89, 0,
25, 82, 82, 32, 0, 20, 82, 82, 40, 0, 23, 89, 89, 35, 0, 18, 89, 89, 44, 0,
44, 21, 0, 0, 19, 0, 0, 15, 53, 0, 49, 21, 0, 0, 19, 0, 0, 15, 59, 0,
18, 0, 16, 15, 11, 10, 9, 82, 57, 61, 18, 0, 15, 12, 11, 10, 9, 89, 64, 68,
65, 69, 73, 12, 77, 11, 10 72, 76, 80, 13, 84, 12, 10
} ; } ;
static yyconst flex_int16_t yy_def[48] = static yyconst flex_int16_t yy_def[48] =
@ -427,34 +427,36 @@ static yyconst flex_int16_t yy_def[48] =
38, 38, 38, 38, 38, 38, 38 38, 38, 38, 38, 38, 38, 38
} ; } ;
static yyconst flex_int16_t yy_nxt[94] = static yyconst flex_int16_t yy_nxt[102] =
{ 0, { 0,
6, 7, 8, 9, 10, 11, 12, 13, 6, 14, 6, 7, 8, 7, 9, 10, 11, 12, 13, 6,
15, 17, 18, 37, 36, 34, 30, 20, 30, 19, 14, 15, 17, 37, 18, 36, 34, 30, 20, 30,
17, 18, 27, 20, 35, 29, 27, 33, 19, 20, 27, 19, 17, 20, 18, 35, 29, 27, 33, 29,
29, 25, 21, 38, 22, 38, 38, 20, 20, 23, 25, 19, 20, 38, 38, 38, 21, 38, 22, 38,
26, 26, 28, 28, 30, 38, 38, 20, 38, 31, 38, 20, 20, 23, 26, 26, 28, 38, 28, 30,
38, 38, 30, 30, 32, 28, 28, 16, 16, 16, 30, 38, 38, 20, 38, 31, 38, 38, 30, 30,
16, 24, 38, 24, 24, 27, 38, 27, 27, 28, 32, 28, 38, 28, 16, 16, 16, 16, 24, 38,
38, 38, 28, 20, 38, 20, 20, 30, 38, 30, 24, 24, 27, 38, 27, 27, 28, 38, 38, 28,
30, 5, 38, 38, 38, 38, 38, 38, 38, 38, 20, 38, 20, 20, 30, 38, 30, 30, 5, 38,
38, 38, 38 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38
} ; } ;
static yyconst flex_int16_t yy_chk[94] = static yyconst flex_int16_t yy_chk[102] =
{ 0, { 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 3, 3, 47, 46, 44, 37, 36, 35, 3, 1, 1, 3, 47, 3, 46, 44, 37, 36, 35,
4, 4, 34, 33, 31, 28, 25, 22, 4, 6, 34, 3, 4, 33, 4, 31, 28, 25, 22, 16,
16, 11, 6, 5, 6, 0, 0, 6, 6, 6, 11, 4, 6, 5, 0, 0, 6, 0, 6, 0,
14, 14, 19, 19, 21, 0, 0, 21, 0, 21, 0, 6, 6, 6, 14, 14, 19, 0, 19, 21,
0, 0, 21, 21, 21, 29, 29, 39, 39, 39, 21, 0, 0, 21, 0, 21, 0, 0, 21, 21,
39, 40, 0, 40, 40, 41, 0, 41, 41, 42, 21, 29, 0, 29, 39, 39, 39, 39, 40, 0,
0, 0, 42, 43, 0, 43, 43, 45, 0, 45, 40, 40, 41, 0, 41, 41, 42, 0, 0, 42,
45, 38, 38, 38, 38, 38, 38, 38, 38, 38, 43, 0, 43, 43, 45, 0, 45, 45, 38, 38,
38, 38, 38 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38
} ; } ;
/* Table of booleans, true if rule could match eol. */ /* Table of booleans, true if rule could match eol. */
@ -560,7 +562,7 @@ static void cmListFileLexerDestroy(cmListFileLexer* lexer);
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
#line 566 "cmListFileLexer.c" #line 568 "cmListFileLexer.c"
#define INITIAL 0 #define INITIAL 0
#define STRING 1 #define STRING 1
@ -777,7 +779,7 @@ YY_DECL
#line 100 "cmListFileLexer.in.l" #line 100 "cmListFileLexer.in.l"
#line 785 "cmListFileLexer.c" #line 787 "cmListFileLexer.c"
if ( yyg->yy_init ) if ( yyg->yy_init )
{ {
@ -836,7 +838,7 @@ yy_match:
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp; ++yy_cp;
} }
while ( yy_base[yy_current_state] != 82 ); while ( yy_base[yy_current_state] != 89 );
yy_find_action: yy_find_action:
yy_act = yy_accept[yy_current_state]; yy_act = yy_accept[yy_current_state];
@ -1006,7 +1008,7 @@ YY_RULE_SETUP
#line 194 "cmListFileLexer.in.l" #line 194 "cmListFileLexer.in.l"
ECHO; ECHO;
YY_BREAK YY_BREAK
#line 1023 "cmListFileLexer.c" #line 1025 "cmListFileLexer.c"
case YY_END_OF_BUFFER: case YY_END_OF_BUFFER:
{ {
@ -2338,4 +2340,3 @@ const char* cmListFileLexer_GetTypeAsString(cmListFileLexer* lexer,
} }
return "unknown token"; return "unknown token";
} }

View File

@ -132,7 +132,7 @@ MAKEVAR \$\([A-Za-z0-9_]*\)
return 1; return 1;
} }
({MAKEVAR}|[^ \t\r\n\(\)#\\\"]|\\.)({MAKEVAR}|[^ \t\r\n\(\)#\\\"]|\\.|\"({MAKEVAR}|[^ \t\r\n\(\)#\\\"]|\\.)*\")* { ({MAKEVAR}|[^ \t\r\n\(\)#\\\"]|\\.)({MAKEVAR}|[^ \t\r\n\(\)#\\\"]|\\.|\"({MAKEVAR}|[^\r\n\(\)#\\\"]|\\.)*\")* {
lexer->token.type = cmListFileLexer_Token_ArgumentUnquoted; lexer->token.type = cmListFileLexer_Token_ArgumentUnquoted;
cmListFileLexerSetToken(lexer, yytext, yyleng); cmListFileLexerSetToken(lexer, yytext, yyleng);
lexer->column += yyleng; lexer->column += yyleng;