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 /libsolidity | |
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 'libsolidity')
-rw-r--r-- | libsolidity/codegen/CompilerContext.cpp | 2 | ||||
-rw-r--r-- | libsolidity/interface/AssemblyStack.cpp | 2 | ||||
-rw-r--r-- | libsolidity/interface/CompilerStack.cpp | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/libsolidity/codegen/CompilerContext.cpp b/libsolidity/codegen/CompilerContext.cpp index 16bc4225..5a3a233c 100644 --- a/libsolidity/codegen/CompilerContext.cpp +++ b/libsolidity/codegen/CompilerContext.cpp @@ -360,7 +360,7 @@ void CompilerContext::appendInlineAssembly( ErrorList errors; ErrorReporter errorReporter(errors); - auto scanner = make_shared<langutil::Scanner>(langutil::CharStream(_assembly, "--CODEGEN--"), "--CODEGEN--"); + auto scanner = make_shared<langutil::Scanner>(langutil::CharStream(_assembly, "--CODEGEN--")); auto parserResult = yul::Parser(errorReporter, yul::AsmFlavour::Strict).parse(scanner, false); #ifdef SOL_OUTPUT_ASM cout << yul::AsmPrinter()(*parserResult) << endl; diff --git a/libsolidity/interface/AssemblyStack.cpp b/libsolidity/interface/AssemblyStack.cpp index 5268c5aa..66ba42ee 100644 --- a/libsolidity/interface/AssemblyStack.cpp +++ b/libsolidity/interface/AssemblyStack.cpp @@ -69,7 +69,7 @@ bool AssemblyStack::parseAndAnalyze(std::string const& _sourceName, std::string { m_errors.clear(); m_analysisSuccessful = false; - m_scanner = make_shared<Scanner>(CharStream(_source, _sourceName), _sourceName); + m_scanner = make_shared<Scanner>(CharStream(_source, _sourceName)); m_parserResult = yul::ObjectParser(m_errorReporter, languageToAsmFlavour(m_language)).parse(m_scanner, false); if (!m_errorReporter.errors().empty()) return false; diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 58229379..534073f1 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -125,7 +125,7 @@ bool CompilerStack::addSource(string const& _name, string const& _content, bool { bool existed = m_sources.count(_name) != 0; reset(true); - m_sources[_name].scanner = make_shared<Scanner>(CharStream(_content, _name), _name); + m_sources[_name].scanner = make_shared<Scanner>(CharStream(_content, _name)); m_sources[_name].isLibrary = _isLibrary; m_stackState = SourcesSet; return existed; @@ -160,7 +160,7 @@ bool CompilerStack::parse() { string const& newPath = newSource.first; string const& newContents = newSource.second; - m_sources[newPath].scanner = make_shared<Scanner>(CharStream(newContents, newPath), newPath); + m_sources[newPath].scanner = make_shared<Scanner>(CharStream(newContents, newPath)); sourcesToParse.push_back(newPath); } } |