Skip to content

Commit 02363d7

Browse files
committed
Python: Document Comment.qll.
I didn't do the `toString` methods in this commit. I'm thinking they're better to do in a separate commit. (There are 48 undocumented instances!)
1 parent fe78e68 commit 02363d7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

python/ql/src/semmle/python/Comment.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* Provides classes representing comments in Python.
3+
*/
4+
15
import python
26

37
/** A source code comment */
@@ -69,12 +73,14 @@ class CommentBlock extends @py_comment {
6973
exists(Comment end | end = this.last() | end.getLocation().hasLocationInfo(_, _, _, endline, endcolumn))
7074
}
7175

76+
/** Holds if this comment block contains `c`. */
7277
predicate contains(Comment c) {
7378
comment_block_part(this, c, _)
7479
or
7580
this = c
7681
}
7782

83+
/** Gets a string representation of this comment block. */
7884
string getContents() {
7985
result =
8086
concat(Comment c, int i |

0 commit comments

Comments
 (0)