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

Method unwindAndContinue

addons/misra_9.py:367–394  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

365 self.root = old
366
367 def unwindAndContinue(self):
368 while self.token:
369 if self.token.astParent.astOperand1 == self.token and self.token.astParent.astOperand2:
370 if self.ed:
371 if self.token.astParent.astOperand2.str == "{" and self.ed.isDesignated:
372 self.popFromStackIfExitElement()
373 else:
374 self.ed.markAsCurrent()
375 self.ed = self.ed.getNextValueElement(self.root)
376
377 self.token = self.token.astParent.astOperand2
378 break
379
380 self.token = self.token.astParent
381 if self.token.str == '{':
382 if self.root:
383 self.ed = self.root.getLastValueElement()
384 self.ed.markAsCurrent()
385
386 # Cleanup if root is dummy node representing excess levels in initializer
387 if self.root.name == '<-':
388 self.root.children[0].parent = self.root.parent
389
390 self.root = self.root.parent
391
392 if self.token.astParent is None:
393 self.token = None
394 break
395
396def misra_9_x(self, data, rule, rawTokens = None):
397

Callers 1

parseInitializerMethod · 0.95

Calls 4

markAsCurrentMethod · 0.80
getNextValueElementMethod · 0.80
getLastValueElementMethod · 0.80

Tested by

no test coverage detected