Fixed #7784 (Token: can't be both type and variable)
This commit is contained in:
parent
55ae961ac2
commit
b6cba4a55c
|
@ -492,11 +492,13 @@ public:
|
||||||
}
|
}
|
||||||
void varId(unsigned int id) {
|
void varId(unsigned int id) {
|
||||||
_varId = id;
|
_varId = id;
|
||||||
if (id != 0)
|
if (id != 0) {
|
||||||
_tokType = eVariable;
|
_tokType = eVariable;
|
||||||
else
|
isStandardType(false);
|
||||||
|
} else {
|
||||||
update_property_info();
|
update_property_info();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For debugging purposes, prints token and all tokens
|
* For debugging purposes, prints token and all tokens
|
||||||
|
|
|
@ -830,6 +830,12 @@ private:
|
||||||
// Change back to standard type
|
// Change back to standard type
|
||||||
tok.str("int");
|
tok.str("int");
|
||||||
ASSERT_EQUALS(true, tok.isStandardType());
|
ASSERT_EQUALS(true, tok.isStandardType());
|
||||||
|
|
||||||
|
// token can't be both type and variable
|
||||||
|
tok.str("abc");
|
||||||
|
tok.isStandardType(true);
|
||||||
|
tok.varId(123);
|
||||||
|
ASSERT_EQUALS(false, tok.isStandardType());
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateProperties() const {
|
void updateProperties() const {
|
||||||
|
|
Loading…
Reference in New Issue