'Detect inline comments.
Return True if the block is an inline comment.'

def is_comment(self, block):

    if (block is None):
        return False
    text = to_text_string(block.text()).lstrip()
    return text.startswith(self.comment_string)
