aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/Scanner.cpp
diff options
context:
space:
mode:
authorLianaHus <liana@ethdev.com>2015-09-01 00:44:29 +0800
committerLianaHus <liana@ethdev.com>2015-09-08 19:12:00 +0800
commit1b5e6fc9e76ad3cf30e6e7bfc0e868dbb5267ff4 (patch)
tree6ecb1323bec51a67a53d63bfd250f4ccfcee926c /libsolidity/Scanner.cpp
parent6f4a39c183a905b8e07da59c17bfd25c2febbf7f (diff)
downloaddexon-solidity-1b5e6fc9e76ad3cf30e6e7bfc0e868dbb5267ff4.tar.gz
dexon-solidity-1b5e6fc9e76ad3cf30e6e7bfc0e868dbb5267ff4.tar.zst
dexon-solidity-1b5e6fc9e76ad3cf30e6e7bfc0e868dbb5267ff4.zip
renamed getter functions
Diffstat (limited to 'libsolidity/Scanner.cpp')
-rw-r--r--libsolidity/Scanner.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/libsolidity/Scanner.cpp b/libsolidity/Scanner.cpp
index fbe3ea97..374f78e4 100644
--- a/libsolidity/Scanner.cpp
+++ b/libsolidity/Scanner.cpp
@@ -202,20 +202,20 @@ Token::Value Scanner::selectToken(char _next, Token::Value _then, Token::Value _
bool Scanner::skipWhitespace()
{
- int const startPosition = getSourcePos();
+ int const startPosition = sourcePos();
while (isWhiteSpace(m_char))
advance();
// Return whether or not we skipped any characters.
- return getSourcePos() != startPosition;
+ return sourcePos() != startPosition;
}
bool Scanner::skipWhitespaceExceptLF()
{
- int const startPosition = getSourcePos();
+ int const startPosition = sourcePos();
while (isWhiteSpace(m_char) && !isLineTerminator(m_char))
advance();
// Return whether or not we skipped any characters.
- return getSourcePos() != startPosition;
+ return sourcePos() != startPosition;
}
Token::Value Scanner::skipSingleLineComment()
@@ -326,7 +326,7 @@ Token::Value Scanner::scanMultiLineDocComment()
Token::Value Scanner::scanSlash()
{
- int firstSlashPosition = getSourcePos();
+ int firstSlashPosition = sourcePos();
advance();
if (m_char == '/')
{
@@ -338,7 +338,7 @@ Token::Value Scanner::scanSlash()
Token::Value comment;
m_nextSkippedComment.location.start = firstSlashPosition;
comment = scanSingleLineDocComment();
- m_nextSkippedComment.location.end = getSourcePos();
+ m_nextSkippedComment.location.end = sourcePos();
m_nextSkippedComment.token = comment;
return Token::Whitespace;
}
@@ -363,7 +363,7 @@ Token::Value Scanner::scanSlash()
Token::Value comment;
m_nextSkippedComment.location.start = firstSlashPosition;
comment = scanMultiLineDocComment();
- m_nextSkippedComment.location.end = getSourcePos();
+ m_nextSkippedComment.location.end = sourcePos();
m_nextSkippedComment.token = comment;
}
return Token::Whitespace;
@@ -385,7 +385,7 @@ void Scanner::scanToken()
do
{
// Remember the position of the next token
- m_nextToken.location.start = getSourcePos();
+ m_nextToken.location.start = sourcePos();
switch (m_char)
{
case '\n': // fall-through
@@ -564,7 +564,7 @@ void Scanner::scanToken()
// whitespace.
}
while (token == Token::Whitespace);
- m_nextToken.location.end = getSourcePos();
+ m_nextToken.location.end = sourcePos();
m_nextToken.token = token;
}
@@ -719,20 +719,20 @@ char CharStream::advanceAndGet(size_t _chars)
{
if (isPastEndOfInput())
return 0;
- m_pos += _chars;
+ m_position += _chars;
if (isPastEndOfInput())
return 0;
- return m_source[m_pos];
+ return m_source[m_position];
}
char CharStream::rollback(size_t _amount)
{
- solAssert(m_pos >= _amount, "");
- m_pos -= _amount;
+ solAssert(m_position >= _amount, "");
+ m_position -= _amount;
return get();
}
-string CharStream::getLineAtPosition(int _position) const
+string CharStream::lineAtPosition(int _position) const
{
// if _position points to \n, it returns the line before the \n
using size_type = string::size_type;