This commit is contained in:
Nyall Dawson 2024-08-10 07:27:58 +10:00
parent 5c9640ab79
commit f0f9afb53e

View File

@ -1868,11 +1868,11 @@ while line_idx < line_count:
if is_override_or_make_private == PREPEND_CODE_VIRTUAL and not re.match(r'^(\s*)virtual\b(.*)$',
rolling_line):
idx = len(output) - line_idx + rolling_line_idx + 2
idx = rolling_line_idx - line_idx + 1
output[idx] = fix_annotations(re.sub(r'^(\s*?)\b(.*)$', r'\1 virtual \2\n', rolling_line))
elif is_override_or_make_private == PREPEND_CODE_MAKE_PRIVATE:
dbg_info("prepending private access")
idx = len(output) - line_idx + rolling_line_idx + 2
idx = rolling_line_idx - line_idx + 1
private_access = re.sub(r'(protected|public)', 'private', last_access_section_line)
output.insert(idx, private_access + "\n")
output[idx + 1] = fix_annotations(rolling_line) + "\n"