Skip to content
Permalink
Browse files
Allow preprocessor to pass through comments, like GNU cpp does.
  • Loading branch information
icculus committed Feb 14, 2013
1 parent 72e69e2 commit 00f25f8944e1c8b177d5a71d2b17afe297af8986

File 2 of 4 in 00f25f8

@@ -1163,7 +1163,9 @@ Token preprocessor_lexer(IncludeState *s)
yy192:
++YYCURSOR;
{
if (saw_newline)
if (s->report_comments)
RET(TOKEN_MULTI_COMMENT);
else if (saw_newline)
RET('\n');
else if (s->report_whitespace)
RET(' ');
@@ -1189,14 +1191,29 @@ Token preprocessor_lexer(IncludeState *s)
}
++YYCURSOR;
yy197:
{ s->line++; token = matchptr; RET('\n'); }
{
s->line++;
if (s->report_comments)
RET(TOKEN_SINGLE_COMMENT);
token = matchptr;
RET('\n');
}
yy198:
yych = *++YYCURSOR;
if (yych == '\n') goto yy203;
goto yy197;
yy199:
++YYCURSOR;
{ if (eoi) { RET(TOKEN_EOI); } goto singlelinecomment; }
{
if (eoi)
{
if (s->report_comments)
RET(TOKEN_SINGLE_COMMENT);
else
RET(TOKEN_EOI);
}
goto singlelinecomment;
}
yy201:
++YYCURSOR;
{ goto singlelinecomment; }

0 comments on commit 00f25f8

Please sign in to comment.