MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / removedirectives

Method removedirectives

tools/reduce.py:196–203  ·  view source on GitHub ↗
(self, filedata)

Source from the content-addressed store, hash-verified

194 return filedata
195
196 def removedirectives(self, filedata):
197 for i in range(len(filedata)):
198 line = filedata[i].lstrip()
199 if line.startswith('#'):
200 # these cannot be removed on their own so skip them
201 if line.startswith('#if') or line.startswith('#endif') or line.startswith('#el'):
202 continue
203 self.replaceandrun('remove preprocessor directive', filedata, i, '')
204
205 def removeblocks(self, filedata):
206 if len(filedata) < 3:

Callers 2

mainFunction · 0.95
test_removedirectivesFunction · 0.80

Calls 1

replaceandrunMethod · 0.95

Tested by 1

test_removedirectivesFunction · 0.64