From f011af81523bd44dc4c446df6e2976d9c1786609 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sat, 29 Aug 2020 21:39:18 +0200 Subject: Fixed line number counting issue with test case cc.h --- src/code.l | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/code.l b/src/code.l index 7709a41..003a1c5 100644 --- a/src/code.l +++ b/src/code.l @@ -2020,7 +2020,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER} else { yyextra->yyLineNr+=QCString(yytext).contains('\n'); - if (QCString(yytext).at(strlen(yytext)-1) == '\n') + if (yytext[yyleng-1]=='\n') { yyextra->yyLineNr--; unput('\n'); @@ -2049,7 +2049,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER} if (YY_START==SkipCPP) REJECT; if (Config_getBool(STRIP_CODE_COMMENTS)) { - yyextra->yyLineNr+=((QCString)yytext).contains('\n'); + yyextra->yyLineNr+=QCString(yytext).contains('\n'); nextCodeLine(yyscanner); } else @@ -2064,10 +2064,10 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER} BEGIN( yyextra->lastCContext ) ; } } -\n/.*\n { +\n/.*\n { endFontClass(yyscanner); - codifyLines(yyscanner,yytext); BEGIN( yyextra->lastSkipCppContext ) ; + unput('\n'); } <*>\n{B}*"//@"[{}].*\n { // remove one-line group marker if (Config_getBool(STRIP_CODE_COMMENTS)) -- cgit v0.12