diff options
author | Christian Parpart <christian@ethereum.org> | 2018-11-29 08:58:15 +0800 |
---|---|---|
committer | Christian Parpart <christian@ethereum.org> | 2018-12-01 00:07:17 +0800 |
commit | 435f7b3b72157e884344adbc7b62033bd08bb51c (patch) | |
tree | de4831bb56b16945894b9efc0bea95576b43cea9 /test | |
parent | c48a5264be4221873fe02cac57f6a41a32010fea (diff) | |
download | dexon-solidity-435f7b3b72157e884344adbc7b62033bd08bb51c.tar.gz dexon-solidity-435f7b3b72157e884344adbc7b62033bd08bb51c.tar.zst dexon-solidity-435f7b3b72157e884344adbc7b62033bd08bb51c.zip |
liblangutil: Scanner: remove superfluous sourceName field (it's in CharStream already)
Also, ParserBase::sourceName() was dead code. Eliminating it should
increase test coverage (how sneaky) :-)
Diffstat (limited to 'test')
-rw-r--r-- | test/libsolidity/SolidityScanner.cpp | 28 | ||||
-rw-r--r-- | test/libyul/Common.cpp | 2 | ||||
-rw-r--r-- | test/libyul/YulOptimizerTest.cpp | 2 | ||||
-rw-r--r-- | test/tools/yulopti.cpp | 2 |
4 files changed, 17 insertions, 17 deletions
diff --git a/test/libsolidity/SolidityScanner.cpp b/test/libsolidity/SolidityScanner.cpp index 95d56568..5ce4eda2 100644 --- a/test/libsolidity/SolidityScanner.cpp +++ b/test/libsolidity/SolidityScanner.cpp @@ -107,10 +107,10 @@ BOOST_AUTO_TEST_CASE(hex_numbers) BOOST_CHECK_EQUAL(scanner.currentLiteral(), "0x765432536763762734623472346"); BOOST_CHECK_EQUAL(scanner.next(), Token::Semicolon); BOOST_CHECK_EQUAL(scanner.next(), Token::EOS); - scanner.reset(CharStream("0x1234", ""), ""); + scanner.reset(CharStream("0x1234", "")); BOOST_CHECK_EQUAL(scanner.currentToken(), Token::Number); BOOST_CHECK_EQUAL(scanner.currentLiteral(), "0x1234"); - scanner.reset(CharStream("0X1234", ""), ""); + scanner.reset(CharStream("0X1234", "")); BOOST_CHECK_EQUAL(scanner.currentToken(), Token::Illegal); } @@ -118,17 +118,17 @@ BOOST_AUTO_TEST_CASE(octal_numbers) { Scanner scanner(CharStream("07", "")); BOOST_CHECK_EQUAL(scanner.currentToken(), Token::Illegal); - scanner.reset(CharStream("007", ""), ""); + scanner.reset(CharStream("007", "")); BOOST_CHECK_EQUAL(scanner.currentToken(), Token::Illegal); - scanner.reset(CharStream("-07", ""), ""); + scanner.reset(CharStream("-07", "")); BOOST_CHECK_EQUAL(scanner.currentToken(), Token::Sub); BOOST_CHECK_EQUAL(scanner.next(), Token::Illegal); - scanner.reset(CharStream("-.07", ""), ""); + scanner.reset(CharStream("-.07", "")); BOOST_CHECK_EQUAL(scanner.currentToken(), Token::Sub); BOOST_CHECK_EQUAL(scanner.next(), Token::Number); - scanner.reset(CharStream("0", ""), ""); + scanner.reset(CharStream("0", "")); BOOST_CHECK_EQUAL(scanner.currentToken(), Token::Number); - scanner.reset(CharStream("0.1", ""), ""); + scanner.reset(CharStream("0.1", "")); BOOST_CHECK_EQUAL(scanner.currentToken(), Token::Number); } @@ -149,16 +149,16 @@ BOOST_AUTO_TEST_CASE(trailing_dot) Scanner scanner(CharStream("2.5", "")); BOOST_CHECK_EQUAL(scanner.currentToken(), Token::Number); BOOST_CHECK_EQUAL(scanner.next(), Token::EOS); - scanner.reset(CharStream("2.5e10", ""), ""); + scanner.reset(CharStream("2.5e10", "")); BOOST_CHECK_EQUAL(scanner.currentToken(), Token::Number); BOOST_CHECK_EQUAL(scanner.next(), Token::EOS); - scanner.reset(CharStream(".5", ""), ""); + scanner.reset(CharStream(".5", "")); BOOST_CHECK_EQUAL(scanner.currentToken(), Token::Number); BOOST_CHECK_EQUAL(scanner.next(), Token::EOS); - scanner.reset(CharStream(".5e10", ""), ""); + scanner.reset(CharStream(".5e10", "")); BOOST_CHECK_EQUAL(scanner.currentToken(), Token::Number); BOOST_CHECK_EQUAL(scanner.next(), Token::EOS); - scanner.reset(CharStream("2.", ""), ""); + scanner.reset(CharStream("2.", "")); BOOST_CHECK_EQUAL(scanner.currentToken(), Token::Number); BOOST_CHECK_EQUAL(scanner.next(), Token::Period); BOOST_CHECK_EQUAL(scanner.next(), Token::EOS); @@ -180,7 +180,7 @@ BOOST_AUTO_TEST_CASE(leading_underscore_decimal_after_dot_illegal) BOOST_CHECK_EQUAL(scanner.currentToken(), Token::Number); BOOST_CHECK_EQUAL(scanner.next(), Token::EOS); - scanner.reset(CharStream("1._", ""), ""); + scanner.reset(CharStream("1._", "")); BOOST_CHECK_EQUAL(scanner.currentToken(), Token::Number); BOOST_CHECK_EQUAL(scanner.next(), Token::EOS); } @@ -225,11 +225,11 @@ BOOST_AUTO_TEST_CASE(number_literals_with_trailing_underscore_at_eos) BOOST_CHECK_EQUAL(scanner.currentToken(), Token::Number); BOOST_CHECK_EQUAL(scanner.next(), Token::EOS); - scanner.reset(CharStream("123_", ""), ""); + scanner.reset(CharStream("123_", "")); BOOST_CHECK_EQUAL(scanner.currentToken(), Token::Number); BOOST_CHECK_EQUAL(scanner.next(), Token::EOS); - scanner.reset(CharStream("12.34_", ""), ""); + scanner.reset(CharStream("12.34_", "")); BOOST_CHECK_EQUAL(scanner.currentToken(), Token::Number); BOOST_CHECK_EQUAL(scanner.next(), Token::EOS); } diff --git a/test/libyul/Common.cpp b/test/libyul/Common.cpp index 36065db7..a247a169 100644 --- a/test/libyul/Common.cpp +++ b/test/libyul/Common.cpp @@ -57,7 +57,7 @@ pair<shared_ptr<Block>, shared_ptr<yul::AsmAnalysisInfo>> yul::test::parse(strin auto flavour = _yul ? yul::AsmFlavour::Yul : yul::AsmFlavour::Strict; ErrorList errors; ErrorReporter errorReporter(errors); - auto scanner = make_shared<Scanner>(CharStream(_source, ""), ""); + auto scanner = make_shared<Scanner>(CharStream(_source, "")); auto parserResult = yul::Parser(errorReporter, flavour).parse(scanner, false); if (parserResult) { diff --git a/test/libyul/YulOptimizerTest.cpp b/test/libyul/YulOptimizerTest.cpp index 8f282aac..15d70faa 100644 --- a/test/libyul/YulOptimizerTest.cpp +++ b/test/libyul/YulOptimizerTest.cpp @@ -259,7 +259,7 @@ bool YulOptimizerTest::parse(ostream& _stream, string const& _linePrefix, bool c yul::AsmFlavour flavour = m_yul ? yul::AsmFlavour::Yul : yul::AsmFlavour::Strict; ErrorList errors; ErrorReporter errorReporter(errors); - shared_ptr<Scanner> scanner = make_shared<Scanner>(CharStream(m_source, ""), ""); + shared_ptr<Scanner> scanner = make_shared<Scanner>(CharStream(m_source, "")); m_ast = yul::Parser(errorReporter, flavour).parse(scanner, false); if (!m_ast || !errorReporter.errors().empty()) { diff --git a/test/tools/yulopti.cpp b/test/tools/yulopti.cpp index 8ecafb29..5273bbb9 100644 --- a/test/tools/yulopti.cpp +++ b/test/tools/yulopti.cpp @@ -81,7 +81,7 @@ public: bool parse(string const& _input) { ErrorReporter errorReporter(m_errors); - shared_ptr<Scanner> scanner = make_shared<Scanner>(CharStream(_input, ""), ""); + shared_ptr<Scanner> scanner = make_shared<Scanner>(CharStream(_input, "")); m_ast = yul::Parser(errorReporter, yul::AsmFlavour::Strict).parse(scanner, false); if (!m_ast || !errorReporter.errors().empty()) { |