aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorChristian Parpart <christian@ethereum.org>2018-11-28 23:13:36 +0800
committerChristian Parpart <christian@ethereum.org>2018-11-29 19:45:27 +0800
commit22eff22492b2d569fe56b59763ddc1cd1cf9ccf4 (patch)
treeea6dc0a75a3c1c7d189ec9bb899884cc4f3eefd6 /libsolidity
parent6060a3682c077d7b329ec9171abdacbf1b383ec7 (diff)
downloaddexon-solidity-22eff22492b2d569fe56b59763ddc1cd1cf9ccf4.tar.gz
dexon-solidity-22eff22492b2d569fe56b59763ddc1cd1cf9ccf4.tar.zst
dexon-solidity-22eff22492b2d569fe56b59763ddc1cd1cf9ccf4.zip
liblangutil: extends CharStream to know about the respective (file-)name (and adapt codebase to it)
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/codegen/CompilerContext.cpp2
-rw-r--r--libsolidity/interface/AssemblyStack.cpp2
-rw-r--r--libsolidity/interface/CompilerStack.cpp4
3 files changed, 4 insertions, 4 deletions
diff --git a/libsolidity/codegen/CompilerContext.cpp b/libsolidity/codegen/CompilerContext.cpp
index 2fd62de2..16bc4225 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--");
+ auto scanner = make_shared<langutil::Scanner>(langutil::CharStream(_assembly, "--CODEGEN--"), "--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 24e190b3..5268c5aa 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);
+ m_scanner = make_shared<Scanner>(CharStream(_source, _sourceName), _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 de4a7ec2..cc5a2102 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);
+ m_sources[_name].scanner = make_shared<Scanner>(CharStream(_content, _name), _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);
+ m_sources[newPath].scanner = make_shared<Scanner>(CharStream(newContents, newPath), newPath);
sourcesToParse.push_back(newPath);
}
}