dump: add isUnsigned/isSigned
This commit is contained in:
parent
6f2480fb4d
commit
2ca85a1c40
|
@ -66,6 +66,8 @@ class Token:
|
||||||
isAssignmentOp Is this token a assignment operator
|
isAssignmentOp Is this token a assignment operator
|
||||||
isComparisonOp Is this token a comparison operator
|
isComparisonOp Is this token a comparison operator
|
||||||
isLogicalOp Is this token a logical operator: && ||
|
isLogicalOp Is this token a logical operator: && ||
|
||||||
|
isUnsigned Is this token a unsigned type
|
||||||
|
isSigned Is this token a signed type
|
||||||
varId varId for token, each variable has a unique non-zero id
|
varId varId for token, each variable has a unique non-zero id
|
||||||
variable Variable information for this token. See the Variable class.
|
variable Variable information for this token. See the Variable class.
|
||||||
function If this token points at a function call, this attribute has the Function
|
function If this token points at a function call, this attribute has the Function
|
||||||
|
@ -110,6 +112,8 @@ class Token:
|
||||||
isAssignmentOp = False
|
isAssignmentOp = False
|
||||||
isComparisonOp = False
|
isComparisonOp = False
|
||||||
isLogicalOp = False
|
isLogicalOp = False
|
||||||
|
isUnsigned = False
|
||||||
|
isSigned = False
|
||||||
varId = None
|
varId = None
|
||||||
variableId = None
|
variableId = None
|
||||||
variable = None
|
variable = None
|
||||||
|
@ -141,6 +145,10 @@ class Token:
|
||||||
type = element.get('type')
|
type = element.get('type')
|
||||||
if type == 'name':
|
if type == 'name':
|
||||||
self.isName = True
|
self.isName = True
|
||||||
|
if element.get('isUnsigned'):
|
||||||
|
self.isUnsigned = True
|
||||||
|
if element.get('isSigned'):
|
||||||
|
self.isSigned = True
|
||||||
elif type == 'number':
|
elif type == 'number':
|
||||||
self.isNumber = True
|
self.isNumber = True
|
||||||
if element.get('isInt'):
|
if element.get('isInt'):
|
||||||
|
|
|
@ -3850,9 +3850,13 @@ void Tokenizer::dump(std::ostream &out) const
|
||||||
out << " <token id=\"" << tok << "\" file=\"" << ErrorLogger::toxml(list.file(tok)) << "\" linenr=\"" << tok->linenr() << '\"';
|
out << " <token id=\"" << tok << "\" file=\"" << ErrorLogger::toxml(list.file(tok)) << "\" linenr=\"" << tok->linenr() << '\"';
|
||||||
out << " str=\"" << ErrorLogger::toxml(tok->str()) << '\"';
|
out << " str=\"" << ErrorLogger::toxml(tok->str()) << '\"';
|
||||||
out << " scope=\"" << tok->scope() << '\"';
|
out << " scope=\"" << tok->scope() << '\"';
|
||||||
if (tok->isName())
|
if (tok->isName()) {
|
||||||
out << " type=\"name\"";
|
out << " type=\"name\"";
|
||||||
else if (tok->isNumber()) {
|
if (tok->isUnsigned())
|
||||||
|
out << " isUnsigned=\"true\"";
|
||||||
|
else if (tok->isSigned())
|
||||||
|
out << " isSigned=\"true\"";
|
||||||
|
} else if (tok->isNumber()) {
|
||||||
out << " type=\"number\"";
|
out << " type=\"number\"";
|
||||||
if (MathLib::isInt(tok->str()))
|
if (MathLib::isInt(tok->str()))
|
||||||
out << " isInt=\"True\"";
|
out << " isInt=\"True\"";
|
||||||
|
|
Loading…
Reference in New Issue