Return a list of (start, end) tuples for each comment block.
(self, content, include_line_comments=False)
| 211 | return self._url(self.stored_name, name, force) |
| 212 | |
| 213 | def get_comment_blocks(self, content, include_line_comments=False): |
| 214 | """ |
| 215 | Return a list of (start, end) tuples for each comment block. |
| 216 | """ |
| 217 | pattern = line_comment_re if include_line_comments else comment_re |
| 218 | return [(match.start(), match.end()) for match in re.finditer(pattern, content)] |
| 219 | |
| 220 | def is_in_comment(self, pos, comments): |
| 221 | for start, end in comments: |