def parse_line()

in src/advisor/parsers/continuation_parser.py [0:0]


    def parse_line(self, line):
        """Parse continuations in a source line.

        Args:
            line (str): The line to parse.

        Returns:
            str: THe concatenated line, or None if a continuation is in progress.
        """
        # Lines ending with \ are not processed immediately, but are concatenated together until a line not ending in
        # \ is encountered. This means that issues reported against the line will have the line number of the final continuation liner rather than the first.
        if line.endswith('\\') or line.endswith('\\\n'):
            if self.continuation_line:
                self.continuation_line += line.rstrip()[:-1]
            else:
                self.continuation_line = line.rstrip()[:-1]
            return None
        elif self.continuation_line:
            line = self.continuation_line + line
            self.continuation_line = None
        return line