def should_terminate_now(self, line, waiting_for):
        """Whether parsing within a comment should terminate now.

        This is used for comment systems where there is no comment-ending
        character. We need it for parsing disabled regions where we don't
        know where a comment block ends, but we know that a comment block
        could end at a line ending. It returns true if, for a given line,
        line is not a comment.
        """
        if waiting_for not in (ParserState.EOL, self._end):
            return False

        if self._continue_regex:
            return (re.match(self._continue_regex, line) is None)

        return False
Whether parsing within a comment should terminate now.

        This is used for comment systems where there is no comment-ending
        character. We need it for parsing disabled regions where we don't
        know where a comment block ends, but we know that a comment block
        could end at a line ending. It returns true if, for a given line,
        line is not a comment.