Skip to content

Commit

Permalink
Problem with with comment recognition for group open and closing comm…
Browse files Browse the repository at this point in the history
…ands

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.
  • Loading branch information
albert-github committed Jul 10, 2019
1 parent 34c9bac commit ef5af76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/scanner.l
Original file line number Diff line number Diff line change
Expand Up @@ -2849,7 +2849,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
}
<FindMembers,FindFields>("//"([!/]?){B}*{CMD}"{")|("/*"([!*]?){B}*{CMD}"{") {
<FindMembers,FindFields>("//"([!/]){B}*{CMD}"{")|("/*"([!*]){B}*{CMD}"{") {
//handleGroupStartCommand(current->name);
if (previous && previous->section==Entry::GROUPDOC_SEC)
{
Expand Down Expand Up @@ -2901,7 +2901,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
}
}
<FindMembers,FindFields,ReadInitializer>"//"([!/]?){B}*{CMD}"}".*|"/*"([!*]?){B}*{CMD}"}"[^*]*"*/" {
<FindMembers,FindFields,ReadInitializer>"//"([!/]){B}*{CMD}"}".*|"/*"([!*]){B}*{CMD}"}"[^*]*"*/" {
bool insideEnum = YY_START==FindFields || (YY_START==ReadInitializer && lastInitializerContext==FindFields); // see bug746226
closeGroup(current,yyFileName,yyLineNr,insideEnum);
}
Expand Down

0 comments on commit ef5af76

Please sign in to comment.