Moc: Make # and ## valid tokens in cpp parsing mode

This is required so preprocessing macros with arguments
can work correctly.

Change-Id: Ia30ede6a3579be13800bf1255d313748e2d696f9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
Lars Knoll 2012-09-10 13:57:23 +02:00 committed by The Qt Project
parent 38f1b4eeae
commit 99194d1db6
2 changed files with 6 additions and 4 deletions

View File

@ -48,7 +48,7 @@ static const short keyword_trans[][128] = {
546,252,544,547,0,38,239,545,25,26,236,234,30,235,27,237,
22,22,22,22,22,22,22,22,22,22,34,41,23,39,24,43,
0,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
8,21,8,8,8,8,8,8,8,8,8,31,548,32,238,8,
8,21,8,8,8,8,8,8,8,8,8,31,549,32,238,8,
0,1,2,3,4,5,6,7,8,9,8,8,10,11,12,13,
14,8,15,16,17,18,19,20,8,8,8,36,245,37,248,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@ -190,7 +190,7 @@ static const short keyword_trans[][128] = {
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,42,0,0,0,28,0,
551,551,551,551,551,551,551,551,551,551,0,0,0,0,0,0,
552,552,552,552,552,552,552,552,552,552,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@ -349,7 +349,7 @@ static const short keyword_trans[][128] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,550,0,0,0,0,549,
0,0,0,0,0,0,0,0,0,0,551,0,0,0,0,550,
0,0,0,0,0,0,0,0,0,0,0,0,0,258,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@ -1000,7 +1000,8 @@ static const struct
{QUOTE, 0, 0, 0, NOTOKEN},
{SINGLEQUOTE, 0, 0, 0, NOTOKEN},
{WHITESPACE, 0, 0, 0, NOTOKEN},
{HASH, 0, 0, 0, HASH},
{HASH, 0, 35, 548, HASH},
{PP_HASHHASH, 0, 0, 0, NOTOKEN},
{BACKSLASH, 0, 0, 0, NOTOKEN},
{CPP_COMMENT, 0, 0, 0, NOTOKEN},
{C_COMMENT, 0, 0, 0, NOTOKEN},

View File

@ -256,6 +256,7 @@ static const Keyword keywords[] = {
{ " ", "WHITESPACE" },
{ "\t", "WHITESPACE" },
{ "#", "HASH" },
{ "##", "PP_HASHHASH" },
{ "\\", "BACKSLASH" },
{ "//", "CPP_COMMENT" },
{ "/*", "C_COMMENT" },