Skip to content

Commit 3bc4b5a

Browse files
committed
Better semicolon removing code
1 parent a4a38e3 commit 3bc4b5a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cpp2python.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ def process_line(line):
4040
V
4141
codecode(param, param)
4242
"""
43-
line = re.sub(';$', '', line) # remove semicolon from the end of line
44-
43+
line = re.sub(';([\r\n]?)$', '\\1', line) # remove semicolon from the end of line
44+
45+
4546
""" remove strings containing opening bracket
4647
4748
if (blabla)

0 commit comments

Comments
 (0)