diff options
author | albert-github <albert.tests@gmail.com> | 2020-08-15 11:12:02 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2020-08-15 11:12:02 (GMT) |
commit | eb3cb7b93be84b0fdb43ade81616f5523b33cd04 (patch) | |
tree | d154eaac897748edcea78f08e7e946c2b2b68864 /src/util.cpp | |
parent | 047adfbbc66eaa432ec9cea00e3801e3b4e1bca8 (diff) | |
download | Doxygen-eb3cb7b93be84b0fdb43ade81616f5523b33cd04.zip Doxygen-eb3cb7b93be84b0fdb43ade81616f5523b33cd04.tar.gz Doxygen-eb3cb7b93be84b0fdb43ade81616f5523b33cd04.tar.bz2 |
Improvement of line count for e.g. warnings
When having a file like (but extended example based on a problem found in CGAL where line numbers were a bit off):
```
/*! The <hr2> class `Face_filtered_graph` is an adaptor that creates a filtered view of a graph */
struct Face_filtered_graph_no_det
{
/*!
* \brief constructs an empty face filtered graph (no face is selected)
*
*
*
*
*
*
*
*
* <table class="params">
* something
* something
* </table>
*
*
*
*
*
*
*
*
* <table class="params">
* something
* something
* </table>
*/
Face_filtered_graph_no_det();
}
```
we get:
```
.../no_det.h:1: warning: Unsupported xml/html tag <hr2> found
.../no_det.h:5: warning: expected <tr> tag but found TK_LNKWORD token instead!
.../no_det.h:17: warning: expected <tr> tag but found TK_LNKWORD token instead!
```
instead of:
```
.../no_det.h:1: warning: Unsupported xml/html tag <hr2> found
.../no_det.h:14: warning: expected <tr> tag but found TK_LNKWORD token instead!
.../no_det.h:26: warning: expected <tr> tag but found TK_LNKWORD token instead!
```
Line counting is in an interpreter, especially when merging blocks etc.) a difficult situation.
- `util.cpp`: `\ilinebr` is an internal newline, but the line count should not be increased
- `commentscan.l`
- put empty lines in output as well otherwise they are missing in the line count
- don't insert `\n` to separate blocks, but use the artificial `\ilinebr`
- properly initialize the `docLine` (important for examples were at the beginning of the block there are a number of newlines
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util.cpp b/src/util.cpp index 2c7af7b..fb7a8dc 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -6580,7 +6580,7 @@ QCString stripLeadingAndTrailingEmptyLines(const QCString &s,int &docLine) while ((c=*p)) { if (c==' ' || c=='\t' || c=='\r') i++,p++; - else if (c=='\\' && qstrncmp(p,"\\ilinebr",8)==0) i+=8,li=i,docLine++,p+=8; + else if (c=='\\' && qstrncmp(p,"\\ilinebr",8)==0) i+=8,li=i,p+=8; else if (c=='\n') i++,li=i,docLine++,p++; else break; } |