Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a824d75

Browse files
committed
C++: Add documentation for the LineComment class
1 parent f8ba4c1 commit a824d75

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

cpp/ql/test/TestUtilities/InlineExpectationsTestPrivate.qll

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,22 @@ import cpp
22

33
private newtype TLineComment = MkLineComment(CppStyleComment c)
44

5+
/**
6+
* Represents a line comment in the CPP style.
7+
* Unlike the `CppStyleComment` class, however, the string returned by `getContents` does _not_
8+
* include the preceding comment marker (`//`).
9+
*/
510
class LineComment extends TLineComment {
611
CppStyleComment comment;
712

813
LineComment() { this = MkLineComment(comment) }
914

15+
/** Returns the contents of the given comment, _without_ the preceding comment marker (`//`). */
1016
string getContents() { result = comment.getContents().suffix(2) }
1117

18+
/** Gets a textual representation of this element. */
1219
string toString() { result = comment.toString() }
1320

21+
/** Gets the location of this comment. */
1422
Location getLocation() { result = comment.getLocation() }
1523
}

0 commit comments

Comments
 (0)