Fix line number error with to end of line comments.

The single line comment "//" was getting double counted.
(cherry picked from commit cbce1ddc04)
This commit is contained in:
Cary R 2010-03-30 10:46:10 -07:00 committed by Stephen Williams
parent 4ee4d735c3
commit 855daae00f
1 changed files with 3 additions and 3 deletions

View File

@ -50,12 +50,12 @@ static int yywrap(void)
%%
/* Skip C++-style comments. */
"//".* { sdflloc.first_line += 1; }
"//".* { ; }
/* Skip C-style comments. */
"/*" { BEGIN(CCOMMENT); }
<CCOMMENT>. { yymore(); }
<CCOMMENT>\n { sdflloc.first_line += 1; yymore(); }
<CCOMMENT>. { ; }
<CCOMMENT>\n { sdflloc.first_line += 1; }
<CCOMMENT>"*/" { BEGIN(0); }
[ \m\t] { /* Skip white space. */; }