diff options
Diffstat (limited to 'libsolidity/parsing')
-rw-r--r-- | libsolidity/parsing/Parser.cpp | 4 | ||||
-rw-r--r-- | libsolidity/parsing/Parser.h | 2 | ||||
-rw-r--r-- | libsolidity/parsing/ParserBase.h | 2 | ||||
-rw-r--r-- | libsolidity/parsing/Scanner.h | 10 |
4 files changed, 9 insertions, 9 deletions
diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp index d3a6aa45..7455cbca 100644 --- a/libsolidity/parsing/Parser.cpp +++ b/libsolidity/parsing/Parser.cpp @@ -40,7 +40,7 @@ namespace solidity class Parser::ASTNodeFactory { public: - ASTNodeFactory(Parser const& _parser): + explicit ASTNodeFactory(Parser const& _parser): m_parser(_parser), m_location(_parser.position(), -1, _parser.sourceName()) {} ASTNodeFactory(Parser const& _parser, ASTPointer<ASTNode> const& _childNode): m_parser(_parser), m_location(_childNode->location()) {} @@ -69,7 +69,7 @@ private: class Parser::RecursionGuard { public: - RecursionGuard(Parser& _parser): + explicit RecursionGuard(Parser& _parser): m_parser(_parser) { m_parser.increaseRecursionDepth(); diff --git a/libsolidity/parsing/Parser.h b/libsolidity/parsing/Parser.h index 5e6f3ef6..0f74880c 100644 --- a/libsolidity/parsing/Parser.h +++ b/libsolidity/parsing/Parser.h @@ -35,7 +35,7 @@ class Scanner; class Parser: public ParserBase { public: - Parser(ErrorReporter& _errorReporter): ParserBase(_errorReporter) {} + explicit Parser(ErrorReporter& _errorReporter): ParserBase(_errorReporter) {} ASTPointer<SourceUnit> parse(std::shared_ptr<Scanner> const& _scanner); diff --git a/libsolidity/parsing/ParserBase.h b/libsolidity/parsing/ParserBase.h index 5b03ab5e..48733fc1 100644 --- a/libsolidity/parsing/ParserBase.h +++ b/libsolidity/parsing/ParserBase.h @@ -36,7 +36,7 @@ class Scanner; class ParserBase { public: - ParserBase(ErrorReporter& errorReporter): m_errorReporter(errorReporter) {} + explicit ParserBase(ErrorReporter& errorReporter): m_errorReporter(errorReporter) {} std::shared_ptr<std::string const> const& sourceName() const; diff --git a/libsolidity/parsing/Scanner.h b/libsolidity/parsing/Scanner.h index d6b48c6f..0adaa6fd 100644 --- a/libsolidity/parsing/Scanner.h +++ b/libsolidity/parsing/Scanner.h @@ -75,7 +75,7 @@ public: int position() const { return m_position; } bool isPastEndOfInput(size_t _charsForward = 0) const { return (m_position + _charsForward) >= m_source.size(); } char get(size_t _charsForward = 0) const { return m_source[m_position + _charsForward]; } - char advanceAndGet(size_t _chars=1); + char advanceAndGet(size_t _chars = 1); char rollback(size_t _amount); void reset() { m_position = 0; } @@ -118,11 +118,11 @@ public: ///@name Information about the current token /// @returns the current token - Token::Value currentToken() + Token::Value currentToken() const { return m_currentToken.token; } - ElementaryTypeNameToken currentElementaryTypeNameToken() + ElementaryTypeNameToken currentElementaryTypeNameToken() const { unsigned firstSize; unsigned secondSize; @@ -219,8 +219,8 @@ private: bool scanEscape(); /// Return the current source position. - int sourcePos() { return m_source.position(); } - bool isSourcePastEndOfInput() { return m_source.isPastEndOfInput(); } + int sourcePos() const { return m_source.position(); } + bool isSourcePastEndOfInput() const { return m_source.isPastEndOfInput(); } TokenDesc m_skippedComment; // desc for current skipped comment TokenDesc m_nextSkippedComment; // desc for next skiped comment |