Skip to content

Commit 6e635cd

Browse files
authored
Addon: cppcheckdata.py Fix bug that token type was not a accacable from 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.
1 parent da5006a commit 6e635cd

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

addons/cppcheckdata.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ class Token:
336336

337337
typeScopeId = None
338338
typeScope = None
339+
type = None
339340

340341
astParentId = None
341342
astParent = None
@@ -355,27 +356,27 @@ def __init__(self, element):
355356
self.previous = None
356357
self.scopeId = element.get('scope')
357358
self.scope = None
358-
type = element.get('type')
359-
if type == 'name':
359+
self.type = element.get('type')
360+
if self.type == 'name':
360361
self.isName = True
361362
if element.get('isUnsigned'):
362363
self.isUnsigned = True
363364
if element.get('isSigned'):
364365
self.isSigned = True
365-
elif type == 'number':
366+
elif self.type == 'number':
366367
self.isNumber = True
367368
if element.get('isInt'):
368369
self.isInt = True
369370
elif element.get('isFloat'):
370371
self.isFloat = True
371-
elif type == 'string':
372+
elif self.type == 'string':
372373
self.isString = True
373374
self.strlen = int(element.get('strlen'))
374-
elif type == 'char':
375+
elif self.type == 'char':
375376
self.isChar = True
376-
elif type == 'boolean':
377+
elif self.type == 'boolean':
377378
self.isBoolean = True
378-
elif type == 'op':
379+
elif self.type == 'op':
379380
self.isOp = True
380381
if element.get('isArithmeticalOp'):
381382
self.isArithmeticalOp = True

0 commit comments

Comments
 (0)