mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Make position optional in dev::validate
This commit is contained in:
parent
dadb4818ba
commit
c01426efec
@ -32,4 +32,10 @@ namespace dev
|
|||||||
/// @returns false if it is invalid and the first invalid position in invalidPosition
|
/// @returns false if it is invalid and the first invalid position in invalidPosition
|
||||||
bool validate(std::string const& _input, size_t& _invalidPosition);
|
bool validate(std::string const& _input, size_t& _invalidPosition);
|
||||||
|
|
||||||
|
inline bool validate(std::string const& _input)
|
||||||
|
{
|
||||||
|
size_t invalidPos;
|
||||||
|
return validate(_input, invalidPos);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -417,9 +417,8 @@ bool ASTJsonConverter::visit(ElementaryTypeNameExpression const& _node)
|
|||||||
bool ASTJsonConverter::visit(Literal const& _node)
|
bool ASTJsonConverter::visit(Literal const& _node)
|
||||||
{
|
{
|
||||||
char const* tokenString = Token::toString(_node.token());
|
char const* tokenString = Token::toString(_node.token());
|
||||||
size_t invalidPos = 0;
|
|
||||||
Json::Value value{_node.value()};
|
Json::Value value{_node.value()};
|
||||||
if (!dev::validate(_node.value(), invalidPos))
|
if (!dev::validate(_node.value()))
|
||||||
value = Json::nullValue;
|
value = Json::nullValue;
|
||||||
Token::Value subdenomination = Token::Value(_node.subDenomination());
|
Token::Value subdenomination = Token::Value(_node.subDenomination());
|
||||||
addJsonNode(_node, "Literal", {
|
addJsonNode(_node, "Literal", {
|
||||||
|
@ -909,8 +909,7 @@ TypePointer StringLiteralType::mobileType() const
|
|||||||
|
|
||||||
bool StringLiteralType::isValidUTF8() const
|
bool StringLiteralType::isValidUTF8() const
|
||||||
{
|
{
|
||||||
size_t dontCare {};
|
return dev::validate(m_value);
|
||||||
return dev::validate(m_value, dontCare);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
shared_ptr<FixedBytesType> FixedBytesType::smallestTypeForLiteral(string const& _literal)
|
shared_ptr<FixedBytesType> FixedBytesType::smallestTypeForLiteral(string const& _literal)
|
||||||
|
Loading…
Reference in New Issue
Block a user