Skip to content

Commit

Permalink
Addon: cppcheckdata.py Fix bug that token type was not a accacable fr…
Browse files Browse the repository at this point in the history
…om outside. (#6010)

The Token class documents that the type ("name/op/...") is accessible to
the Addon which wasn't the case.

It was only read locally to set other variables.
  • Loading branch information
wienans committed Feb 20, 2024
1 parent da5006a commit 6e635cd
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions addons/cppcheckdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ class Token:

typeScopeId = None
typeScope = None
type = None

astParentId = None
astParent = None
Expand All @@ -355,27 +356,27 @@ def __init__(self, element):
self.previous = None
self.scopeId = element.get('scope')
self.scope = None
type = element.get('type')
if type == 'name':
self.type = element.get('type')
if self.type == 'name':
self.isName = True
if element.get('isUnsigned'):
self.isUnsigned = True
if element.get('isSigned'):
self.isSigned = True
elif type == 'number':
elif self.type == 'number':
self.isNumber = True
if element.get('isInt'):
self.isInt = True
elif element.get('isFloat'):
self.isFloat = True
elif type == 'string':
elif self.type == 'string':
self.isString = True
self.strlen = int(element.get('strlen'))
elif type == 'char':
elif self.type == 'char':
self.isChar = True
elif type == 'boolean':
elif self.type == 'boolean':
self.isBoolean = True
elif type == 'op':
elif self.type == 'op':
self.isOp = True
if element.get('isArithmeticalOp'):
self.isArithmeticalOp = True
Expand Down

0 comments on commit 6e635cd

Please sign in to comment.