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

Method _is_other_op

addons/misra.py:3849–3868  ·  view source on GitHub ↗
(expansion_list, arg)

Source from the content-addressed store, hash-verified

3847 re.search(r'[^a-zA-Z0-9_]%s[ ]*##' % arg, expansion_list)
3848
3849 def _is_other_op(expansion_list, arg):
3850 pos = expansion_list.find(arg)
3851 while pos >= 0:
3852 pos1 = pos - 1
3853 pos2 = pos + len(arg)
3854 pos = expansion_list.find(arg, pos2)
3855 if isalnum(expansion_list[pos1]) or expansion_list[pos1] == '_':
3856 continue
3857 if isalnum(expansion_list[pos2]) or expansion_list[pos2] == '_':
3858 continue
3859 while expansion_list[pos1] == ' ':
3860 pos1 = pos1 - 1
3861 if expansion_list[pos1] == '#':
3862 continue
3863 while expansion_list[pos2] == ' ':
3864 pos2 = pos2 + 1
3865 if expansion_list[pos2] == '#':
3866 continue
3867 return True
3868 return False
3869
3870 def _is_arg_macro_usage(directive, arg):
3871 for macro_usage in cfg.macro_usage:

Callers

nothing calls this directly

Calls 2

isalnumFunction · 0.85
findMethod · 0.45

Tested by

no test coverage detected