Add information about whether we know a numeric script type is a float in GetBoundTreeString()
This commit is contained in:
parent
7bca80092d
commit
eacdb8a593
|
@ -13,6 +13,7 @@ namespace Porygon{
|
||||||
shared_ptr<const NumericScriptType> NumericScriptType::AwareInt = make_shared<const NumericScriptType>(true, false);
|
shared_ptr<const NumericScriptType> NumericScriptType::AwareInt = make_shared<const NumericScriptType>(true, false);
|
||||||
shared_ptr<const NumericScriptType> NumericScriptType::AwareFloat = make_shared<const NumericScriptType>(true, true);
|
shared_ptr<const NumericScriptType> NumericScriptType::AwareFloat = make_shared<const NumericScriptType>(true, true);
|
||||||
shared_ptr<const NumericScriptType> NumericScriptType::Unaware = make_shared<const NumericScriptType>(false, false);
|
shared_ptr<const NumericScriptType> NumericScriptType::Unaware = make_shared<const NumericScriptType>(false, false);
|
||||||
|
|
||||||
shared_ptr<const StringScriptType> StringScriptType::Dynamic = make_shared<const StringScriptType>(false,
|
shared_ptr<const StringScriptType> StringScriptType::Dynamic = make_shared<const StringScriptType>(false,
|
||||||
Utilities::HashedString::CreateLookup(0));
|
Utilities::HashedString::CreateLookup(0));
|
||||||
|
|
||||||
|
@ -84,6 +85,21 @@ namespace Porygon{
|
||||||
return ToString(this->_class);
|
return ToString(this->_class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string NumericScriptType::ToString() const {
|
||||||
|
std::stringstream ss;
|
||||||
|
ss << "numeric ";
|
||||||
|
if (this->_awareOfFloat && _isFloat){
|
||||||
|
ss << "(Known float)";
|
||||||
|
}
|
||||||
|
else if (this ->_awareOfFloat && !_isFloat){
|
||||||
|
ss << "(Known integer)";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
ss << "(Unknown)";
|
||||||
|
}
|
||||||
|
return ss.str();
|
||||||
|
}
|
||||||
|
|
||||||
bool ScriptType::IsCountable() const {
|
bool ScriptType::IsCountable() const {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,6 +125,8 @@ namespace Porygon{
|
||||||
}
|
}
|
||||||
return ScriptType::CastableTo(castType, explicitCast);
|
return ScriptType::CastableTo(castType, explicitCast);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string ToString() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class StringScriptType : public ScriptType{
|
class StringScriptType : public ScriptType{
|
||||||
|
|
Loading…
Reference in New Issue