mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
styling fixes
This commit is contained in:
parent
43961a552d
commit
b4b0e37e7a
22
Scanner.cpp
22
Scanner.cpp
@ -104,12 +104,12 @@ int HexValue(char c)
|
|||||||
|
|
||||||
void Scanner::reset(CharStream const& _source)
|
void Scanner::reset(CharStream const& _source)
|
||||||
{
|
{
|
||||||
bool found_doc_comment;
|
bool foundDocComment;
|
||||||
m_source = _source;
|
m_source = _source;
|
||||||
m_char = m_source.get();
|
m_char = m_source.get();
|
||||||
skipWhitespace();
|
skipWhitespace();
|
||||||
found_doc_comment = scanToken();
|
foundDocComment = scanToken();
|
||||||
next(found_doc_comment);
|
next(foundDocComment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -135,10 +135,10 @@ bool Scanner::scanHexByte(char& o_scannedByte)
|
|||||||
// Ensure that tokens can be stored in a byte.
|
// Ensure that tokens can be stored in a byte.
|
||||||
BOOST_STATIC_ASSERT(Token::NUM_TOKENS <= 0x100);
|
BOOST_STATIC_ASSERT(Token::NUM_TOKENS <= 0x100);
|
||||||
|
|
||||||
Token::Value Scanner::next(bool _change_skipped_comment)
|
Token::Value Scanner::next(bool _changeSkippedComment)
|
||||||
{
|
{
|
||||||
m_current_token = m_next_token;
|
m_current_token = m_next_token;
|
||||||
if (scanToken() || _change_skipped_comment)
|
if (scanToken() || _changeSkippedComment)
|
||||||
m_skipped_comment = m_next_skipped_comment;
|
m_skipped_comment = m_next_skipped_comment;
|
||||||
return m_current_token.token;
|
return m_current_token.token;
|
||||||
}
|
}
|
||||||
@ -173,7 +173,7 @@ Token::Value Scanner::skipSingleLineComment()
|
|||||||
return Token::WHITESPACE;
|
return Token::WHITESPACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// For the moment this function simply consumes a single line triple slash doc comment
|
/// For the moment this function simply consumes a single line triple slash doc comment
|
||||||
Token::Value Scanner::scanDocumentationComment()
|
Token::Value Scanner::scanDocumentationComment()
|
||||||
{
|
{
|
||||||
LiteralScope literal(this);
|
LiteralScope literal(this);
|
||||||
@ -213,7 +213,7 @@ Token::Value Scanner::skipMultiLineComment()
|
|||||||
|
|
||||||
bool Scanner::scanToken()
|
bool Scanner::scanToken()
|
||||||
{
|
{
|
||||||
bool found_doc_comment = false;
|
bool foundDocComment = false;
|
||||||
m_next_token.literal.clear();
|
m_next_token.literal.clear();
|
||||||
Token::Value token;
|
Token::Value token;
|
||||||
do
|
do
|
||||||
@ -326,7 +326,7 @@ bool Scanner::scanToken()
|
|||||||
m_next_skipped_comment.location.end = getSourcePos();
|
m_next_skipped_comment.location.end = getSourcePos();
|
||||||
m_next_skipped_comment.token = comment;
|
m_next_skipped_comment.token = comment;
|
||||||
token = Token::WHITESPACE;
|
token = Token::WHITESPACE;
|
||||||
found_doc_comment = true;
|
foundDocComment = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
token = skipSingleLineComment();
|
token = skipSingleLineComment();
|
||||||
@ -423,7 +423,7 @@ bool Scanner::scanToken()
|
|||||||
m_next_token.location.end = getSourcePos();
|
m_next_token.location.end = getSourcePos();
|
||||||
m_next_token.token = token;
|
m_next_token.token = token;
|
||||||
|
|
||||||
return found_doc_comment;
|
return foundDocComment;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Scanner::scanEscape()
|
bool Scanner::scanEscape()
|
||||||
@ -567,9 +567,9 @@ Token::Value Scanner::scanNumber(char _charSeen)
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// Keyword Matcher
|
// Keyword Matcher
|
||||||
|
|
||||||
#define KEYWORDS(KEYWORD_GROUP, KEYWORD) \
|
#define KEYWORDS(KEYWORD_GROUP, KEYWORD) \
|
||||||
KEYWORD_GROUP('a') \
|
KEYWORD_GROUP('a') \
|
||||||
KEYWORD("address", Token::ADDRESS) \
|
KEYWORD("address", Token::ADDRESS) \
|
||||||
KEYWORD_GROUP('b') \
|
KEYWORD_GROUP('b') \
|
||||||
KEYWORD("break", Token::BREAK) \
|
KEYWORD("break", Token::BREAK) \
|
||||||
KEYWORD("bool", Token::BOOL) \
|
KEYWORD("bool", Token::BOOL) \
|
||||||
|
@ -119,7 +119,7 @@ public:
|
|||||||
/// Returns the next token and advances input. If called from reset()
|
/// Returns the next token and advances input. If called from reset()
|
||||||
/// and ScanToken() found a documentation token then next should be called
|
/// and ScanToken() found a documentation token then next should be called
|
||||||
/// with _change_skipped_comment=true
|
/// with _change_skipped_comment=true
|
||||||
Token::Value next(bool _change_skipped_comment = false);
|
Token::Value next(bool _changeSkippedComment = false);
|
||||||
|
|
||||||
///@{
|
///@{
|
||||||
///@name Information about the current token
|
///@name Information about the current token
|
||||||
@ -157,7 +157,7 @@ public:
|
|||||||
///@}
|
///@}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Used for the current and look-ahead token and comments
|
/// Used for the current and look-ahead token and comments
|
||||||
struct TokenDesc
|
struct TokenDesc
|
||||||
{
|
{
|
||||||
Token::Value token;
|
Token::Value token;
|
||||||
|
Loading…
Reference in New Issue
Block a user