aboutsummaryrefslogtreecommitdiffstats
path: root/SolidityScanner.cpp
diff options
context:
space:
mode:
authorsubtly <subtly@users.noreply.github.com>2015-01-11 02:46:05 +0800
committersubtly <subtly@users.noreply.github.com>2015-01-11 02:46:05 +0800
commitfeb4288b27195fa84098122d7af864ee5ffd9dbf (patch)
tree0a846b3bf5b49fde0eecee369b8c22452ac941dc /SolidityScanner.cpp
parenta1c972075eeca086dd7f95b9dfe72737d00457b0 (diff)
parent8bc90cb7f82aebfdfc0c9367a838f3a936d5ff1a (diff)
downloaddexon-solidity-feb4288b27195fa84098122d7af864ee5ffd9dbf.tar.gz
dexon-solidity-feb4288b27195fa84098122d7af864ee5ffd9dbf.tar.zst
dexon-solidity-feb4288b27195fa84098122d7af864ee5ffd9dbf.zip
Merge branch 'develop' into p2p
Diffstat (limited to 'SolidityScanner.cpp')
-rw-r--r--SolidityScanner.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/SolidityScanner.cpp b/SolidityScanner.cpp
index b7942d29..7dc9ef48 100644
--- a/SolidityScanner.cpp
+++ b/SolidityScanner.cpp
@@ -103,14 +103,17 @@ BOOST_AUTO_TEST_CASE(negative_numbers)
BOOST_CHECK_EQUAL(scanner.getCurrentToken(), Token::VAR);
BOOST_CHECK_EQUAL(scanner.next(), Token::IDENTIFIER);
BOOST_CHECK_EQUAL(scanner.next(), Token::ASSIGN);
+ BOOST_CHECK_EQUAL(scanner.next(), Token::SUB);
BOOST_CHECK_EQUAL(scanner.next(), Token::NUMBER);
- BOOST_CHECK_EQUAL(scanner.getCurrentLiteral(), "-.2");
+ BOOST_CHECK_EQUAL(scanner.getCurrentLiteral(), ".2");
BOOST_CHECK_EQUAL(scanner.next(), Token::ADD);
+ BOOST_CHECK_EQUAL(scanner.next(), Token::SUB);
BOOST_CHECK_EQUAL(scanner.next(), Token::NUMBER);
- BOOST_CHECK_EQUAL(scanner.getCurrentLiteral(), "-0x78");
+ BOOST_CHECK_EQUAL(scanner.getCurrentLiteral(), "0x78");
BOOST_CHECK_EQUAL(scanner.next(), Token::ADD);
+ BOOST_CHECK_EQUAL(scanner.next(), Token::SUB);
BOOST_CHECK_EQUAL(scanner.next(), Token::NUMBER);
- BOOST_CHECK_EQUAL(scanner.getCurrentLiteral(), "-7.3");
+ BOOST_CHECK_EQUAL(scanner.getCurrentLiteral(), "7.3");
BOOST_CHECK_EQUAL(scanner.next(), Token::ADD);
BOOST_CHECK_EQUAL(scanner.next(), Token::NUMBER);
BOOST_CHECK_EQUAL(scanner.getCurrentLiteral(), "8.9");
@@ -130,8 +133,9 @@ BOOST_AUTO_TEST_CASE(locations)
BOOST_CHECK_EQUAL(scanner.next(), Token::SEMICOLON);
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.next(), Token::NUMBER);
- BOOST_CHECK_EQUAL(scanner.getCurrentLocation().start, 26);
+ 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().start, 45);