From ef5af7618fbec3ac240e7a1099607d9ff2b3cc4f Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 10 Jul 2019 18:48:53 +0200 Subject: Problem with with comment recognition for group open and closing commands Besides the wanted start of comments `//!`, `///`, `/*!` and `/**` also the "normal" comments `//` and `/*` were recognized as starting a comment for the group open (`\{`, `@{`) and group closing (`\}`, `@}`) commands. This was due to the usage of `?` in the regular expression meaning 0 or 1 times. --- src/scanner.l | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scanner.l b/src/scanner.l index 42058d8..ea19382 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -2849,7 +2849,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) } } -("//"([!/]?){B}*{CMD}"{")|("/*"([!*]?){B}*{CMD}"{") { +("//"([!/]){B}*{CMD}"{")|("/*"([!*]){B}*{CMD}"{") { //handleGroupStartCommand(current->name); if (previous && previous->section==Entry::GROUPDOC_SEC) { @@ -2901,7 +2901,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) } } } -"//"([!/]?){B}*{CMD}"}".*|"/*"([!*]?){B}*{CMD}"}"[^*]*"*/" { +"//"([!/]){B}*{CMD}"}".*|"/*"([!*]){B}*{CMD}"}"[^*]*"*/" { bool insideEnum = YY_START==FindFields || (YY_START==ReadInitializer && lastInitializerContext==FindFields); // see bug746226 closeGroup(current,yyFileName,yyLineNr,insideEnum); } -- cgit v0.12