aboutsummaryrefslogtreecommitdiffstats
path: root/solidityScanner.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-10-09 02:53:50 +0800
committerChristian <c@ethdev.com>2014-10-09 02:53:50 +0800
commit9766467f50a5a34776d80744238687fea3fbbec0 (patch)
tree76bad25356e0d7ac8385b4373803f1ecb3811e66 /solidityScanner.cpp
parent762817f8383b5ddbf4de7f0c3595681e7c89f69a (diff)
downloaddexon-solidity-9766467f50a5a34776d80744238687fea3fbbec0.tar.gz
dexon-solidity-9766467f50a5a34776d80744238687fea3fbbec0.tar.zst
dexon-solidity-9766467f50a5a34776d80744238687fea3fbbec0.zip
Parse everything up to function bodies and report parser errors with location.
Diffstat (limited to 'solidityScanner.cpp')
-rw-r--r--solidityScanner.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/solidityScanner.cpp b/solidityScanner.cpp
index 7f84146a..759d2f10 100644
--- a/solidityScanner.cpp
+++ b/solidityScanner.cpp
@@ -98,23 +98,23 @@ BOOST_AUTO_TEST_CASE(locations)
{
Scanner scanner(CharStream("function_identifier has ; -0x743/*comment*/\n ident //comment"));
BOOST_CHECK_EQUAL(scanner.getCurrentToken(), Token::IDENTIFIER);
- BOOST_CHECK_EQUAL(scanner.getCurrentLocation().beg_pos, 0);
- BOOST_CHECK_EQUAL(scanner.getCurrentLocation().end_pos, 19);
+ BOOST_CHECK_EQUAL(scanner.getCurrentLocation().start, 0);
+ BOOST_CHECK_EQUAL(scanner.getCurrentLocation().end, 19);
BOOST_CHECK_EQUAL(scanner.next(), Token::IDENTIFIER);
- BOOST_CHECK_EQUAL(scanner.getCurrentLocation().beg_pos, 20);
- BOOST_CHECK_EQUAL(scanner.getCurrentLocation().end_pos, 23);
+ BOOST_CHECK_EQUAL(scanner.getCurrentLocation().start, 20);
+ BOOST_CHECK_EQUAL(scanner.getCurrentLocation().end, 23);
BOOST_CHECK_EQUAL(scanner.next(), Token::SEMICOLON);
- BOOST_CHECK_EQUAL(scanner.getCurrentLocation().beg_pos, 24);
- BOOST_CHECK_EQUAL(scanner.getCurrentLocation().end_pos, 25);
+ BOOST_CHECK_EQUAL(scanner.getCurrentLocation().start, 24);
+ BOOST_CHECK_EQUAL(scanner.getCurrentLocation().end, 25);
BOOST_CHECK_EQUAL(scanner.next(), Token::SUB);
- BOOST_CHECK_EQUAL(scanner.getCurrentLocation().beg_pos, 26);
- BOOST_CHECK_EQUAL(scanner.getCurrentLocation().end_pos, 27);
+ BOOST_CHECK_EQUAL(scanner.getCurrentLocation().start, 26);
+ BOOST_CHECK_EQUAL(scanner.getCurrentLocation().end, 27);
BOOST_CHECK_EQUAL(scanner.next(), Token::NUMBER);
- BOOST_CHECK_EQUAL(scanner.getCurrentLocation().beg_pos, 27);
- BOOST_CHECK_EQUAL(scanner.getCurrentLocation().end_pos, 32);
+ BOOST_CHECK_EQUAL(scanner.getCurrentLocation().start, 27);
+ BOOST_CHECK_EQUAL(scanner.getCurrentLocation().end, 32);
BOOST_CHECK_EQUAL(scanner.next(), Token::IDENTIFIER);
- BOOST_CHECK_EQUAL(scanner.getCurrentLocation().beg_pos, 45);
- BOOST_CHECK_EQUAL(scanner.getCurrentLocation().end_pos, 50);
+ BOOST_CHECK_EQUAL(scanner.getCurrentLocation().start, 45);
+ BOOST_CHECK_EQUAL(scanner.getCurrentLocation().end, 50);
BOOST_CHECK_EQUAL(scanner.next(), Token::EOS);
}