@@ -27,8 +27,6 @@ def run_command(cmd):
27
27
28
28
def parseLine (line , line_no , test_case , incremental_edit_args , reparse_args ,
29
29
current_reparse_start ):
30
- pre_column_offset = 1
31
- post_column_offset = 1
32
30
pre_edit_line = ""
33
31
post_edit_line = ""
34
32
@@ -55,31 +53,29 @@ def parseLine(line, line_no, test_case, incremental_edit_args, reparse_args,
55
53
suffix = subst_match .group (5 )
56
54
57
55
if match_test_case == test_case :
58
- pre_edit_line += prefix + pre_edit
59
- post_edit_line += prefix + post_edit
60
-
61
56
# Compute the -incremental-edit argument for swift-syntax-test
62
- column = pre_column_offset + len (prefix )
57
+ column = len ( pre_edit_line ) + len (prefix ) + 1
63
58
edit_arg = '%d:%d-%d:%d=%s' % \
64
59
(line_no , column , line_no , column + len (pre_edit ),
65
60
post_edit )
66
61
incremental_edit_args .append ('-incremental-edit' )
67
62
incremental_edit_args .append (edit_arg )
63
+
64
+ pre_edit_line += prefix + pre_edit
65
+ post_edit_line += prefix + post_edit
68
66
else :
69
67
# For different test cases just take the pre-edit text
70
68
pre_edit_line += prefix + pre_edit
71
69
post_edit_line += prefix + pre_edit
72
70
73
71
line = suffix
74
- pre_column_offset += len (pre_edit_line )
75
- post_column_offset += len (post_edit_line )
76
72
elif reparse_match :
77
73
prefix = reparse_match .group (1 )
78
74
is_closing = len (reparse_match .group (2 )) > 0
79
75
match_test_case = reparse_match .group (3 )
80
76
suffix = reparse_match .group (4 )
81
77
if match_test_case == test_case :
82
- column = post_column_offset + len (prefix )
78
+ column = len ( post_edit_line ) + len (prefix ) + 1
83
79
if is_closing :
84
80
if not current_reparse_start :
85
81
raise TestFailedError ('Closing unopened reparse tag '
0 commit comments