import re


def _process_long_lines(script_data):
    """Converts to python a pyshell expression that takes more than one line. An example would be:
    f = `echo The string \
        on several \
        lines

    :param script_data: the string of the whole script
    :return: the shellpy script converted to intermediate form
    """
    code_long_line_pattern = re.compile(r'([a-z]*)`(((.*?\\\s*?$)[\n\r]{1,2})+(.*$))', re.MULTILINE)
    new_script_data = code_long_line_pattern.sub(r'longline_shexe(\2)shexe(\1)shexe', script_data)
    return new_script_data