mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Mark functions static
This commit is contained in:
parent
6cec0789b5
commit
efa4598c23
@ -129,7 +129,7 @@ string ASTJsonConverter::sourceLocationToString(SourceLocation const& _location)
|
|||||||
return std::to_string(_location.start) + ":" + std::to_string(length) + ":" + std::to_string(sourceIndex);
|
return std::to_string(_location.start) + ":" + std::to_string(length) + ":" + std::to_string(sourceIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
string ASTJsonConverter::namePathToString(std::vector<ASTString> const& _namePath) const
|
string ASTJsonConverter::namePathToString(std::vector<ASTString> const& _namePath)
|
||||||
{
|
{
|
||||||
return boost::algorithm::join(_namePath, ".");
|
return boost::algorithm::join(_namePath, ".");
|
||||||
}
|
}
|
||||||
@ -171,7 +171,7 @@ void ASTJsonConverter::appendExpressionAttributes(
|
|||||||
_attributes += exprAttributes;
|
_attributes += exprAttributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
Json::Value ASTJsonConverter::inlineAssemblyIdentifierToJson(pair<assembly::Identifier const* ,InlineAssemblyAnnotation::ExternalIdentifierInfo> _info)
|
Json::Value ASTJsonConverter::inlineAssemblyIdentifierToJson(pair<assembly::Identifier const* ,InlineAssemblyAnnotation::ExternalIdentifierInfo> _info) const
|
||||||
{
|
{
|
||||||
Json::Value tuple(Json::objectValue);
|
Json::Value tuple(Json::objectValue);
|
||||||
tuple["src"] = sourceLocationToString(_info.first->location);
|
tuple["src"] = sourceLocationToString(_info.first->location);
|
||||||
|
@ -120,7 +120,7 @@ private:
|
|||||||
std::vector<std::pair<std::string, Json::Value>>&& _attributes
|
std::vector<std::pair<std::string, Json::Value>>&& _attributes
|
||||||
);
|
);
|
||||||
std::string sourceLocationToString(SourceLocation const& _location) const;
|
std::string sourceLocationToString(SourceLocation const& _location) const;
|
||||||
std::string namePathToString(std::vector<ASTString> const& _namePath) const;
|
static std::string namePathToString(std::vector<ASTString> const& _namePath);
|
||||||
static Json::Value idOrNull(ASTNode const* _pt)
|
static Json::Value idOrNull(ASTNode const* _pt)
|
||||||
{
|
{
|
||||||
return _pt ? Json::Value(nodeId(*_pt)) : Json::nullValue;
|
return _pt ? Json::Value(nodeId(*_pt)) : Json::nullValue;
|
||||||
@ -129,13 +129,13 @@ private:
|
|||||||
{
|
{
|
||||||
return _node ? toJson(*_node) : Json::nullValue;
|
return _node ? toJson(*_node) : Json::nullValue;
|
||||||
}
|
}
|
||||||
Json::Value inlineAssemblyIdentifierToJson(std::pair<assembly::Identifier const* , InlineAssemblyAnnotation::ExternalIdentifierInfo> _info);
|
Json::Value inlineAssemblyIdentifierToJson(std::pair<assembly::Identifier const* , InlineAssemblyAnnotation::ExternalIdentifierInfo> _info) const;
|
||||||
std::string location(VariableDeclaration::Location _location);
|
static std::string location(VariableDeclaration::Location _location);
|
||||||
std::string contractKind(ContractDefinition::ContractKind _kind);
|
static std::string contractKind(ContractDefinition::ContractKind _kind);
|
||||||
std::string functionCallKind(FunctionCallKind _kind);
|
static std::string functionCallKind(FunctionCallKind _kind);
|
||||||
std::string literalTokenKind(Token::Value _token);
|
static std::string literalTokenKind(Token::Value _token);
|
||||||
std::string type(Expression const& _expression);
|
static std::string type(Expression const& _expression);
|
||||||
std::string type(VariableDeclaration const& _varDecl);
|
static std::string type(VariableDeclaration const& _varDecl);
|
||||||
static int nodeId(ASTNode const& _node)
|
static int nodeId(ASTNode const& _node)
|
||||||
{
|
{
|
||||||
return _node.id();
|
return _node.id();
|
||||||
@ -151,8 +151,8 @@ private:
|
|||||||
}
|
}
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
Json::Value typePointerToJson(TypePointer _tp);
|
static Json::Value typePointerToJson(TypePointer _tp);
|
||||||
Json::Value typePointerToJson(std::shared_ptr<std::vector<TypePointer>> _tps);
|
static Json::Value typePointerToJson(std::shared_ptr<std::vector<TypePointer>> _tps);
|
||||||
void appendExpressionAttributes(
|
void appendExpressionAttributes(
|
||||||
std::vector<std::pair<std::string, Json::Value>> &_attributes,
|
std::vector<std::pair<std::string, Json::Value>> &_attributes,
|
||||||
ExpressionAnnotation const& _annotation
|
ExpressionAnnotation const& _annotation
|
||||||
|
@ -1819,7 +1819,7 @@ void ExpressionCompiler::setLValueToStorageItem(Expression const& _expression)
|
|||||||
setLValue<StorageItem>(_expression, *_expression.annotation().type);
|
setLValue<StorageItem>(_expression, *_expression.annotation().type);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ExpressionCompiler::cleanupNeededForOp(Type::Category _type, Token::Value _op) const
|
bool ExpressionCompiler::cleanupNeededForOp(Type::Category _type, Token::Value _op)
|
||||||
{
|
{
|
||||||
if (Token::isCompareOp(_op) || Token::isShiftOp(_op))
|
if (Token::isCompareOp(_op) || Token::isShiftOp(_op))
|
||||||
return true;
|
return true;
|
||||||
|
@ -119,7 +119,7 @@ private:
|
|||||||
|
|
||||||
/// @returns true if the operator applied to the given type requires a cleanup prior to the
|
/// @returns true if the operator applied to the given type requires a cleanup prior to the
|
||||||
/// operation.
|
/// operation.
|
||||||
bool cleanupNeededForOp(Type::Category _type, Token::Value _op) const;
|
static bool cleanupNeededForOp(Type::Category _type, Token::Value _op);
|
||||||
|
|
||||||
/// @returns the CompilerUtils object containing the current context.
|
/// @returns the CompilerUtils object containing the current context.
|
||||||
CompilerUtils utils();
|
CompilerUtils utils();
|
||||||
|
@ -59,8 +59,8 @@ protected:
|
|||||||
|
|
||||||
void printErrors();
|
void printErrors();
|
||||||
|
|
||||||
ContractDefinition const* retrieveContractByName(SourceUnit const& _source, std::string const& _name);
|
static ContractDefinition const* retrieveContractByName(SourceUnit const& _source, std::string const& _name);
|
||||||
FunctionTypePointer retrieveFunctionBySignature(
|
static FunctionTypePointer retrieveFunctionBySignature(
|
||||||
ContractDefinition const& _contract,
|
ContractDefinition const& _contract,
|
||||||
std::string const& _signature
|
std::string const& _signature
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user