16 lines = open(file).readlines()
19 for i
in range(len(lines)):
23 while lines[i][j] !=
'\n':
29 if lines[i][j+1] ==
'*' and not commentStage:
31 commentStartLine, commentStartColumn = i, j
34 elif not commentStage
and (lines[i][j+1] ==
'/'):
35 lines[i] = lines[i].
replace(lines[i][j:],
'\n', 1)
40 next = lines[i][j+1:].
find(
'"')
41 lines[i] = lines[i].
replace(lines[i][j:j+next+2],
'', 1)
45 next = lines[i][j+1:].
find(
'\'')
46 lines[i] = lines[i].
replace(lines[i][j:j+next+2],
'', 1)
49 if (commentStage
and (lines[i][j+1] ==
'/')):
51 if commentStartLine != i:
52 lines[i] = lines[i].
replace(lines[i][:j+2],
'', 1)
55 lines[i] = lines[i].
replace(lines[i][commentStartColumn:j+2],
'', 1)
56 j = commentStartColumn - 1
57 if j != len(lines[i]) - 1:
63 if i == commentStartLine: lines[i] = lines[i].
replace(lines[i][commentStartColumn:],
'\n', 1)
64 else: lines[i] = lines[i].
replace(lines[i][:],
'\n')