mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
- inline and assembly keywords added
- some style fixes
This commit is contained in:
parent
67793f1aed
commit
58e07151e3
@ -826,7 +826,7 @@ public:
|
|||||||
/// @returns TypePointer of a new FunctionType object. All input/return parameters are an
|
/// @returns TypePointer of a new FunctionType object. All input/return parameters are an
|
||||||
/// appropriate external types (i.e. the interfaceType()s) of input/return parameters of
|
/// appropriate external types (i.e. the interfaceType()s) of input/return parameters of
|
||||||
/// current function.
|
/// current function.
|
||||||
/// Returns an empty shared pointer if one of the input/return parameters does not have an
|
/// @returns an empty shared pointer if one of the input/return parameters does not have an
|
||||||
/// external type.
|
/// external type.
|
||||||
FunctionTypePointer interfaceFunctionType() const;
|
FunctionTypePointer interfaceFunctionType() const;
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ public:
|
|||||||
std::string translation() const;
|
std::string translation() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// Returns an error.
|
/// Creates an error and adds it to errors list.
|
||||||
void error(ASTNode const& _node, std::string const& _description);
|
void error(ASTNode const& _node, std::string const& _description);
|
||||||
/// Reports a fatal error and throws.
|
/// Reports a fatal error and throws.
|
||||||
void fatalError(ASTNode const& _node, std::string const& _description);
|
void fatalError(ASTNode const& _node, std::string const& _description);
|
||||||
|
@ -101,7 +101,7 @@ public:
|
|||||||
/// Sets the given source code as the only source unit apart from standard sources and parses it.
|
/// Sets the given source code as the only source unit apart from standard sources and parses it.
|
||||||
/// @returns false on error.
|
/// @returns false on error.
|
||||||
bool parse(std::string const& _sourceCode);
|
bool parse(std::string const& _sourceCode);
|
||||||
/// Returns a list of the contract names in the sources.
|
/// @returns a list of the contract names in the sources.
|
||||||
std::vector<std::string> contractNames() const;
|
std::vector<std::string> contractNames() const;
|
||||||
std::string defaultContractName() const;
|
std::string defaultContractName() const;
|
||||||
|
|
||||||
@ -144,13 +144,13 @@ public:
|
|||||||
/// Prerequisite: Successful compilation.
|
/// Prerequisite: Successful compilation.
|
||||||
Json::Value streamAssembly(std::ostream& _outStream, std::string const& _contractName = "", StringMap _sourceCodes = StringMap(), bool _inJsonFormat = false) const;
|
Json::Value streamAssembly(std::ostream& _outStream, std::string const& _contractName = "", StringMap _sourceCodes = StringMap(), bool _inJsonFormat = false) const;
|
||||||
|
|
||||||
/// Returns a string representing the contract interface in JSON.
|
/// @returns a string representing the contract interface in JSON.
|
||||||
/// Prerequisite: Successful call to parse or compile.
|
/// Prerequisite: Successful call to parse or compile.
|
||||||
std::string const& interface(std::string const& _contractName = "") const;
|
std::string const& interface(std::string const& _contractName = "") const;
|
||||||
/// Returns a string representing the contract interface in Solidity.
|
/// @returns a string representing the contract interface in Solidity.
|
||||||
/// Prerequisite: Successful call to parse or compile.
|
/// Prerequisite: Successful call to parse or compile.
|
||||||
std::string const& solidityInterface(std::string const& _contractName = "") const;
|
std::string const& solidityInterface(std::string const& _contractName = "") const;
|
||||||
/// Returns a string representing the contract's documentation in JSON.
|
/// @returns a string representing the contract's documentation in JSON.
|
||||||
/// Prerequisite: Successful call to parse or compile.
|
/// Prerequisite: Successful call to parse or compile.
|
||||||
/// @param type The type of the documentation to get.
|
/// @param type The type of the documentation to get.
|
||||||
/// Can be one of 4 types defined at @c DocumentationType
|
/// Can be one of 4 types defined at @c DocumentationType
|
||||||
|
@ -85,7 +85,7 @@ public:
|
|||||||
static std::string devDocumentation(ContractDefinition const& _contractDef);
|
static std::string devDocumentation(ContractDefinition const& _contractDef);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// Returns concatenation of all content under the given tag name.
|
/// @returns concatenation of all content under the given tag name.
|
||||||
static std::string extractDoc(std::multimap<std::string, DocTag> const& _tags, std::string const& _name);
|
static std::string extractDoc(std::multimap<std::string, DocTag> const& _tags, std::string const& _name);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -124,12 +124,12 @@ private:
|
|||||||
/// For source code of the form "a[][8]" ("IndexAccessStructure"), this is not possible to
|
/// For source code of the form "a[][8]" ("IndexAccessStructure"), this is not possible to
|
||||||
/// decide with constant look-ahead.
|
/// decide with constant look-ahead.
|
||||||
LookAheadInfo peekStatementType() const;
|
LookAheadInfo peekStatementType() const;
|
||||||
/// Returns a typename parsed in look-ahead fashion from something like "a.b[8][2**70]".
|
/// @returns a typename parsed in look-ahead fashion from something like "a.b[8][2**70]".
|
||||||
ASTPointer<TypeName> typeNameIndexAccessStructure(
|
ASTPointer<TypeName> typeNameIndexAccessStructure(
|
||||||
std::vector<ASTPointer<PrimaryExpression>> const& _path,
|
std::vector<ASTPointer<PrimaryExpression>> const& _path,
|
||||||
std::vector<std::pair<ASTPointer<Expression>, SourceLocation>> const& _indices
|
std::vector<std::pair<ASTPointer<Expression>, SourceLocation>> const& _indices
|
||||||
);
|
);
|
||||||
/// Returns an expression parsed in look-ahead fashion from something like "a.b[8][2**70]".
|
/// @returns an expression parsed in look-ahead fashion from something like "a.b[8][2**70]".
|
||||||
ASTPointer<Expression> expressionFromIndexAccessStructure(
|
ASTPointer<Expression> expressionFromIndexAccessStructure(
|
||||||
std::vector<ASTPointer<PrimaryExpression>> const& _path,
|
std::vector<ASTPointer<PrimaryExpression>> const& _path,
|
||||||
std::vector<std::pair<ASTPointer<Expression>, SourceLocation>> const& _indices
|
std::vector<std::pair<ASTPointer<Expression>, SourceLocation>> const& _indices
|
||||||
|
@ -108,13 +108,13 @@ public:
|
|||||||
/// Resets scanner to the start of input.
|
/// Resets scanner to the start of input.
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
/// Returns the next token and advances input
|
/// @returns the next token and advances input
|
||||||
Token::Value next();
|
Token::Value next();
|
||||||
|
|
||||||
///@{
|
///@{
|
||||||
///@name Information about the current token
|
///@name Information about the current token
|
||||||
|
|
||||||
/// Returns the current token
|
/// @returns the current token
|
||||||
Token::Value currentToken()
|
Token::Value currentToken()
|
||||||
{
|
{
|
||||||
return m_currentToken.token;
|
return m_currentToken.token;
|
||||||
@ -138,7 +138,7 @@ public:
|
|||||||
///@{
|
///@{
|
||||||
///@name Information about the next token
|
///@name Information about the next token
|
||||||
|
|
||||||
/// Returns the next token without advancing input.
|
/// @returns the next token without advancing input.
|
||||||
Token::Value peekNextToken() const { return m_nextToken.token; }
|
Token::Value peekNextToken() const { return m_nextToken.token; }
|
||||||
SourceLocation peekLocation() const { return m_nextToken.location; }
|
SourceLocation peekLocation() const { return m_nextToken.location; }
|
||||||
std::string const& peekLiteral() const { return m_nextToken.literal; }
|
std::string const& peekLiteral() const { return m_nextToken.literal; }
|
||||||
|
@ -143,6 +143,7 @@ namespace solidity
|
|||||||
\
|
\
|
||||||
/* Keywords */ \
|
/* Keywords */ \
|
||||||
K(Anonymous, "anonymous", 0) \
|
K(Anonymous, "anonymous", 0) \
|
||||||
|
K(Assembly, "assembly", 0) \
|
||||||
K(Break, "break", 0) \
|
K(Break, "break", 0) \
|
||||||
K(Const, "constant", 0) \
|
K(Const, "constant", 0) \
|
||||||
K(Continue, "continue", 0) \
|
K(Continue, "continue", 0) \
|
||||||
@ -220,6 +221,7 @@ namespace solidity
|
|||||||
K(Case, "case", 0) \
|
K(Case, "case", 0) \
|
||||||
K(Catch, "catch", 0) \
|
K(Catch, "catch", 0) \
|
||||||
K(Final, "final", 0) \
|
K(Final, "final", 0) \
|
||||||
|
K(Inline, "inline", 0) \
|
||||||
K(Let, "let", 0) \
|
K(Let, "let", 0) \
|
||||||
K(Match, "match", 0) \
|
K(Match, "match", 0) \
|
||||||
K(Of, "of", 0) \
|
K(Of, "of", 0) \
|
||||||
@ -251,7 +253,7 @@ public:
|
|||||||
};
|
};
|
||||||
#undef T
|
#undef T
|
||||||
|
|
||||||
// Returns a string corresponding to the C++ token name
|
// @returns a string corresponding to the C++ token name
|
||||||
// (e.g. "LT" for the token LT).
|
// (e.g. "LT" for the token LT).
|
||||||
static char const* name(Value tok)
|
static char const* name(Value tok)
|
||||||
{
|
{
|
||||||
@ -285,7 +287,7 @@ public:
|
|||||||
static bool isEtherSubdenomination(Value op) { return op == SubWei || op == SubSzabo || op == SubFinney || op == SubEther; }
|
static bool isEtherSubdenomination(Value op) { return op == SubWei || op == SubSzabo || op == SubFinney || op == SubEther; }
|
||||||
static bool isTimeSubdenomination(Value op) { return op == SubSecond || op == SubMinute || op == SubHour || op == SubDay || op == SubWeek || op == SubYear; }
|
static bool isTimeSubdenomination(Value op) { return op == SubSecond || op == SubMinute || op == SubHour || op == SubDay || op == SubWeek || op == SubYear; }
|
||||||
|
|
||||||
// Returns a string corresponding to the JS token string
|
// @returns a string corresponding to the JS token string
|
||||||
// (.e., "<" for the token LT) or NULL if the token doesn't
|
// (.e., "<" for the token LT) or NULL if the token doesn't
|
||||||
// have a (unique) string (e.g. an IDENTIFIER).
|
// have a (unique) string (e.g. an IDENTIFIER).
|
||||||
static char const* toString(Value tok)
|
static char const* toString(Value tok)
|
||||||
@ -294,7 +296,7 @@ public:
|
|||||||
return m_string[tok];
|
return m_string[tok];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the precedence > 0 for binary and compare
|
// @returns the precedence > 0 for binary and compare
|
||||||
// operators; returns 0 otherwise.
|
// operators; returns 0 otherwise.
|
||||||
static int precedence(Value tok)
|
static int precedence(Value tok)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user