16 lines = open(file).readlines()
17 except UnicodeDecodeError
as e:
18 print(
"CppCommentSkipper: WARNING: Invalid UTF-8 sequence in {0}".
format(file))
19 lines = open(file, errors=
'replace').readlines()
22 for i
in range(len(lines)):
26 while lines[i][j] !=
'\n':
32 if lines[i][j+1] ==
'*' and not commentStage:
34 commentStartLine, commentStartColumn = i, j
37 elif not commentStage
and (lines[i][j+1] ==
'/'):
38 lines[i] = lines[i].
replace(lines[i][j:],
'\n', 1)
43 next = lines[i][j+1:].
find(
'"')
44 lines[i] = lines[i].
replace(lines[i][j:j+next+2],
'', 1)
48 next = lines[i][j+1:].
find(
'\'')
49 lines[i] = lines[i].
replace(lines[i][j:j+next+2],
'', 1)
52 if (commentStage
and (lines[i][j+1] ==
'/')):
54 if commentStartLine != i:
55 lines[i] = lines[i].
replace(lines[i][:j+2],
'', 1)
58 lines[i] = lines[i].
replace(lines[i][commentStartColumn:j+2],
'', 1)
59 j = commentStartColumn - 1
60 if j != len(lines[i]) - 1:
66 if i == commentStartLine: lines[i] = lines[i].
replace(lines[i][commentStartColumn:],
'\n', 1)
67 else: lines[i] = lines[i].
replace(lines[i][:],
'\n')
69 def replace(string, replacements)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)