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

Function get_vartok

addons/misra.py:556–569  ·  view source on GitHub ↗
(expr)

Source from the content-addressed store, hash-verified

554
555def get_type_conversion_to_from(token):
556 def get_vartok(expr):
557 while expr:
558 if isCast(expr):
559 if expr.astOperand2 is None:
560 expr = expr.astOperand1
561 else:
562 expr = expr.astOperand2
563 elif expr.str in ('.', '::'):
564 expr = expr.astOperand2
565 elif expr.str == '[':
566 expr = expr.astOperand1
567 else:
568 break
569 return expr if (expr and expr.variable) else None
570
571 if isCast(token):
572 vartok = get_vartok(token)

Callers 1

Calls 1

isCastFunction · 0.70

Tested by

no test coverage detected