|
@ -116,8 +116,8 @@ def get_indent(line): |
|
|
def format_source_to_return_parser(source, cutoff_line, restart_line, col_offset, parser_name): |
|
|
def format_source_to_return_parser(source, cutoff_line, restart_line, col_offset, parser_name): |
|
|
top = source[:cutoff_line - 1] |
|
|
top = source[:cutoff_line - 1] |
|
|
bottom = source[restart_line:] |
|
|
bottom = source[restart_line:] |
|
|
|
|
|
indentation = source[cutoff_line - 1][:col_offset] |
|
|
return_statement = ['{}return {}\n\n'.format(' ' * col_offset, parser_name)] |
|
|
return_statement = ['{}return {}\n\n'.format(indentation, parser_name)] |
|
|
|
|
|
|
|
|
# stitch it all back together excluding the Gooey decorator |
|
|
# stitch it all back together excluding the Gooey decorator |
|
|
new_source = (line for line in chain(top, return_statement, bottom) |
|
|
new_source = (line for line in chain(top, return_statement, bottom) |
|
|
xxxxxxxxxx