aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorLianaHus <liana@ethdev.com>2015-09-10 20:26:34 +0800
committerLianaHus <liana@ethdev.com>2015-09-10 20:26:34 +0800
commit845bcf8db09c536c157a7575981daa42b6e6e938 (patch)
tree07557b43dc18366d3ce9be99c6d63737b4864437 /libsolidity
parent3fc2561223c989885e1473cb29394bb07a26492f (diff)
downloaddexon-solidity-845bcf8db09c536c157a7575981daa42b6e6e938.tar
dexon-solidity-845bcf8db09c536c157a7575981daa42b6e6e938.tar.gz
dexon-solidity-845bcf8db09c536c157a7575981daa42b6e6e938.tar.bz2
dexon-solidity-845bcf8db09c536c157a7575981daa42b6e6e938.tar.lz
dexon-solidity-845bcf8db09c536c157a7575981daa42b6e6e938.tar.xz
dexon-solidity-845bcf8db09c536c157a7575981daa42b6e6e938.tar.zst
dexon-solidity-845bcf8db09c536c157a7575981daa42b6e6e938.zip
- added tests to test empty comment
- fixed skipSingleLineComment - some style fixes
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/Parser.cpp7
-rw-r--r--libsolidity/Scanner.cpp4
2 files changed, 7 insertions, 4 deletions
diff --git a/libsolidity/Parser.cpp b/libsolidity/Parser.cpp
index e001d0f1..7f779ed0 100644
--- a/libsolidity/Parser.cpp
+++ b/libsolidity/Parser.cpp
@@ -69,7 +69,7 @@ ASTPointer<SourceUnit> Parser::parse(shared_ptr<Scanner> const& _scanner)
m_scanner = _scanner;
ASTNodeFactory nodeFactory(*this);
vector<ASTPointer<ASTNode>> nodes;
- while (_scanner->currentToken() != Token::EOS)
+ while (m_scanner->currentToken() != Token::EOS)
{
switch (m_scanner->currentToken())
{
@@ -1076,8 +1076,9 @@ ASTPointer<ParameterList> Parser::createEmptyParameterList()
ParserError Parser::createParserError(string const& _description) const
{
- return ParserError() << errinfo_sourceLocation(SourceLocation(position(), position(), sourceName()))
- << errinfo_comment(_description);
+ return ParserError() <<
+ errinfo_sourceLocation(SourceLocation(position(), position(), sourceName())) <<
+ errinfo_comment(_description);
}
diff --git a/libsolidity/Scanner.cpp b/libsolidity/Scanner.cpp
index 374f78e4..d67b6423 100644
--- a/libsolidity/Scanner.cpp
+++ b/libsolidity/Scanner.cpp
@@ -224,7 +224,9 @@ Token::Value Scanner::skipSingleLineComment()
// to be part of the single-line comment; it is recognized
// separately by the lexical grammar and becomes part of the
// stream of input elements for the syntactic grammar
- while (advance() && !isLineTerminator(m_char)) { };
+ while (!isLineTerminator(m_char))
+ if (!advance()) break;
+
return Token::Whitespace;
}