mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #10167 from ethereum/drop-old-reporter
[BREAKING] Remove --old-reporter from solc
This commit is contained in:
commit
a6158e65c2
@ -4,6 +4,7 @@ Breaking Changes:
|
||||
* Assembler: The artificial ASSIGNIMMUTABLE opcode and the corresponding builtin in the "EVM with object access" dialect of Yul take the base offset of the code to modify as additional argument.
|
||||
* Code Generator: All arithmetic is checked by default. These checks can be disabled using ``unchecked { ... }``.
|
||||
* Code Generator: Cause a panic if a byte array in storage is accessed whose length is encoded incorrectly.
|
||||
* Command Line Interface: Remove the ``--old-reporter`` option.
|
||||
* Command Line Interface: Remove the legacy ``--ast-json`` option. Only the ``--ast-compact-json`` option is supported now.
|
||||
* General: Remove global functions ``log0``, ``log1``, ``log2``, ``log3`` and ``log4``.
|
||||
* Standard JSON: Remove the ``legacyAST`` option.
|
||||
|
@ -21,8 +21,6 @@ set(sources
|
||||
SourceReferenceExtractor.h
|
||||
SourceReferenceFormatter.cpp
|
||||
SourceReferenceFormatter.h
|
||||
SourceReferenceFormatterHuman.cpp
|
||||
SourceReferenceFormatterHuman.h
|
||||
Token.cpp
|
||||
Token.h
|
||||
UndefMacros.h
|
||||
|
@ -16,62 +16,160 @@
|
||||
*/
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
/**
|
||||
* @author Christian <c@ethdev.com>
|
||||
* @date 2014
|
||||
* Formatting functions for errors referencing positions and locations in the source.
|
||||
*/
|
||||
|
||||
#include <liblangutil/SourceReferenceFormatter.h>
|
||||
#include <liblangutil/Scanner.h>
|
||||
#include <liblangutil/Exceptions.h>
|
||||
#include <libsolutil/UTF8.h>
|
||||
#include <iomanip>
|
||||
#include <string_view>
|
||||
|
||||
using namespace std;
|
||||
using namespace solidity;
|
||||
using namespace solidity::util;
|
||||
using namespace solidity::langutil;
|
||||
using namespace solidity::util;
|
||||
using namespace solidity::util::formatting;
|
||||
|
||||
void SourceReferenceFormatter::printSourceLocation(SourceLocation const* _location)
|
||||
namespace
|
||||
{
|
||||
printSourceLocation(SourceReferenceExtractor::extract(_location));
|
||||
|
||||
std::string replaceNonTabs(std::string_view _utf8Input, char _filler)
|
||||
{
|
||||
std::string output;
|
||||
for (char const c: _utf8Input)
|
||||
if ((c & 0xc0) != 0x80)
|
||||
output.push_back(c == '\t' ? '\t' : _filler);
|
||||
return output;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
AnsiColorized SourceReferenceFormatter::normalColored() const
|
||||
{
|
||||
return AnsiColorized(m_stream, m_colored, {WHITE});
|
||||
}
|
||||
|
||||
AnsiColorized SourceReferenceFormatter::frameColored() const
|
||||
{
|
||||
return AnsiColorized(m_stream, m_colored, {BOLD, BLUE});
|
||||
}
|
||||
|
||||
AnsiColorized SourceReferenceFormatter::errorColored() const
|
||||
{
|
||||
return AnsiColorized(m_stream, m_colored, {BOLD, RED});
|
||||
}
|
||||
|
||||
AnsiColorized SourceReferenceFormatter::messageColored() const
|
||||
{
|
||||
return AnsiColorized(m_stream, m_colored, {BOLD, WHITE});
|
||||
}
|
||||
|
||||
AnsiColorized SourceReferenceFormatter::secondaryColored() const
|
||||
{
|
||||
return AnsiColorized(m_stream, m_colored, {BOLD, CYAN});
|
||||
}
|
||||
|
||||
AnsiColorized SourceReferenceFormatter::highlightColored() const
|
||||
{
|
||||
return AnsiColorized(m_stream, m_colored, {YELLOW});
|
||||
}
|
||||
|
||||
AnsiColorized SourceReferenceFormatter::diagColored() const
|
||||
{
|
||||
return AnsiColorized(m_stream, m_colored, {BOLD, YELLOW});
|
||||
}
|
||||
|
||||
void SourceReferenceFormatter::printSourceLocation(SourceReference const& _ref)
|
||||
{
|
||||
if (_ref.position.line < 0)
|
||||
if (_ref.sourceName.empty())
|
||||
return; // Nothing we can print here
|
||||
|
||||
if (_ref.position.line < 0)
|
||||
{
|
||||
frameColored() << "-->";
|
||||
m_stream << ' ' << _ref.sourceName << '\n';
|
||||
return; // No line available, nothing else to print
|
||||
}
|
||||
|
||||
string line = std::to_string(_ref.position.line + 1); // one-based line number as string
|
||||
string leftpad = string(line.size(), ' ');
|
||||
|
||||
// line 0: source name
|
||||
m_stream << leftpad;
|
||||
frameColored() << "-->";
|
||||
m_stream << ' ' << _ref.sourceName << ':' << line << ':' << (_ref.position.column + 1) << ":\n";
|
||||
|
||||
string_view text = _ref.text;
|
||||
|
||||
if (!_ref.multiline)
|
||||
{
|
||||
m_stream << _ref.text << endl;
|
||||
size_t const locationLength = static_cast<size_t>(_ref.endColumn - _ref.startColumn);
|
||||
|
||||
// mark the text-range like this: ^-----^
|
||||
for_each(
|
||||
_ref.text.cbegin(),
|
||||
_ref.text.cbegin() + _ref.startColumn,
|
||||
[this](char ch) { m_stream << (ch == '\t' ? '\t' : ' '); }
|
||||
// line 1:
|
||||
m_stream << leftpad << ' ';
|
||||
frameColored() << '|';
|
||||
m_stream << '\n';
|
||||
|
||||
// line 2:
|
||||
frameColored() << line << " |";
|
||||
|
||||
m_stream << ' ' << text.substr(0, static_cast<size_t>(_ref.startColumn));
|
||||
highlightColored() << text.substr(static_cast<size_t>(_ref.startColumn), locationLength);
|
||||
m_stream << text.substr(static_cast<size_t>(_ref.endColumn)) << '\n';
|
||||
|
||||
// line 3:
|
||||
m_stream << leftpad << ' ';
|
||||
frameColored() << '|';
|
||||
|
||||
m_stream << ' ' << replaceNonTabs(text.substr(0, static_cast<size_t>(_ref.startColumn)), ' ');
|
||||
diagColored() << (
|
||||
locationLength == 0 ?
|
||||
"^" :
|
||||
replaceNonTabs(text.substr(static_cast<size_t>(_ref.startColumn), locationLength), '^')
|
||||
);
|
||||
m_stream << "^";
|
||||
if (_ref.endColumn > _ref.startColumn + 2)
|
||||
m_stream << string(static_cast<size_t>(_ref.endColumn - _ref.startColumn - 2), '-');
|
||||
if (_ref.endColumn > _ref.startColumn + 1)
|
||||
m_stream << "^";
|
||||
m_stream << endl;
|
||||
m_stream << '\n';
|
||||
}
|
||||
else
|
||||
m_stream <<
|
||||
_ref.text <<
|
||||
endl <<
|
||||
string(static_cast<size_t>(_ref.startColumn), ' ') <<
|
||||
"^ (Relevant source part starts here and spans across multiple lines)." <<
|
||||
endl;
|
||||
{
|
||||
// line 1:
|
||||
m_stream << leftpad << ' ';
|
||||
frameColored() << '|';
|
||||
m_stream << '\n';
|
||||
|
||||
// line 2:
|
||||
frameColored() << line << " |";
|
||||
m_stream << ' ' << text.substr(0, static_cast<size_t>(_ref.startColumn));
|
||||
highlightColored() << text.substr(static_cast<size_t>(_ref.startColumn)) << '\n';
|
||||
|
||||
// line 3:
|
||||
m_stream << leftpad << ' ';
|
||||
frameColored() << '|';
|
||||
m_stream << ' ' << replaceNonTabs(text.substr(0, static_cast<size_t>(_ref.startColumn)), ' ');
|
||||
diagColored() << "^ (Relevant source part starts here and spans across multiple lines).";
|
||||
m_stream << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
void SourceReferenceFormatter::printSourceName(SourceReference const& _ref)
|
||||
void SourceReferenceFormatter::printExceptionInformation(SourceReferenceExtractor::Message const& _msg)
|
||||
{
|
||||
if (_ref.position.line != -1)
|
||||
m_stream << _ref.sourceName << ":" << (_ref.position.line + 1) << ":" << (_ref.position.column + 1) << ": ";
|
||||
else if (!_ref.sourceName.empty())
|
||||
m_stream << _ref.sourceName << ": ";
|
||||
// exception header line
|
||||
errorColored() << _msg.category;
|
||||
if (m_withErrorIds && _msg.errorId.has_value())
|
||||
errorColored() << " (" << _msg.errorId.value().error << ")";
|
||||
messageColored() << ": " << _msg.primary.message << '\n';
|
||||
|
||||
printSourceLocation(_msg.primary);
|
||||
|
||||
for (auto const& secondary: _msg.secondary)
|
||||
{
|
||||
secondaryColored() << "Note";
|
||||
messageColored() << ":" << (secondary.message.empty() ? "" : (" " + secondary.message)) << '\n';
|
||||
printSourceLocation(secondary);
|
||||
}
|
||||
|
||||
m_stream << '\n';
|
||||
}
|
||||
|
||||
void SourceReferenceFormatter::printExceptionInformation(util::Exception const& _exception, std::string const& _category)
|
||||
@ -83,19 +181,3 @@ void SourceReferenceFormatter::printErrorInformation(Error const& _error)
|
||||
{
|
||||
printExceptionInformation(SourceReferenceExtractor::extract(_error));
|
||||
}
|
||||
|
||||
void SourceReferenceFormatter::printExceptionInformation(SourceReferenceExtractor::Message const& _msg)
|
||||
{
|
||||
printSourceName(_msg.primary);
|
||||
|
||||
m_stream << _msg.category << ": " << _msg.primary.message << endl;
|
||||
|
||||
printSourceLocation(_msg.primary);
|
||||
|
||||
for (auto const& ref: _msg.secondary)
|
||||
{
|
||||
printSourceName(ref);
|
||||
m_stream << ref.message << endl;
|
||||
printSourceLocation(ref);
|
||||
}
|
||||
}
|
||||
|
@ -16,45 +16,49 @@
|
||||
*/
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
/**
|
||||
* @author Christian <c@ethdev.com>
|
||||
* @date 2014
|
||||
* Formatting functions for errors referencing positions and locations in the source.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <functional>
|
||||
#include <liblangutil/Exceptions.h>
|
||||
#include <liblangutil/SourceReferenceExtractor.h>
|
||||
|
||||
namespace solidity::util
|
||||
{
|
||||
struct Exception; // forward
|
||||
}
|
||||
#include <libsolutil/AnsiColorized.h>
|
||||
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <functional>
|
||||
|
||||
namespace solidity::langutil
|
||||
{
|
||||
struct SourceLocation;
|
||||
class Scanner;
|
||||
|
||||
class SourceReferenceFormatter
|
||||
{
|
||||
public:
|
||||
explicit SourceReferenceFormatter(std::ostream& _stream):
|
||||
m_stream(_stream)
|
||||
SourceReferenceFormatter(std::ostream& _stream, bool _colored, bool _withErrorIds):
|
||||
m_stream(_stream), m_colored(_colored), m_withErrorIds(_withErrorIds)
|
||||
{}
|
||||
|
||||
virtual ~SourceReferenceFormatter() = default;
|
||||
|
||||
/// Prints source location if it is given.
|
||||
virtual void printSourceLocation(SourceReference const& _ref);
|
||||
virtual void printExceptionInformation(SourceReferenceExtractor::Message const& _msg);
|
||||
void printSourceLocation(SourceReference const& _ref);
|
||||
void printExceptionInformation(SourceReferenceExtractor::Message const& _msg);
|
||||
void printExceptionInformation(util::Exception const& _exception, std::string const& _category);
|
||||
void printErrorInformation(Error const& _error);
|
||||
|
||||
virtual void printSourceLocation(SourceLocation const* _location);
|
||||
virtual void printExceptionInformation(util::Exception const& _exception, std::string const& _category);
|
||||
virtual void printErrorInformation(Error const& _error);
|
||||
static std::string formatExceptionInformation(
|
||||
util::Exception const& _exception,
|
||||
std::string const& _name,
|
||||
bool _colored = false,
|
||||
bool _withErrorIds = false
|
||||
)
|
||||
{
|
||||
std::ostringstream errorOutput;
|
||||
SourceReferenceFormatter formatter(errorOutput, _colored, _withErrorIds);
|
||||
formatter.printExceptionInformation(_exception, _name);
|
||||
return errorOutput.str();
|
||||
}
|
||||
|
||||
static std::string formatErrorInformation(Error const& _error)
|
||||
{
|
||||
@ -64,23 +68,19 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
static std::string formatExceptionInformation(
|
||||
util::Exception const& _exception,
|
||||
std::string const& _name
|
||||
)
|
||||
{
|
||||
std::ostringstream errorOutput;
|
||||
|
||||
SourceReferenceFormatter formatter(errorOutput);
|
||||
formatter.printExceptionInformation(_exception, _name);
|
||||
return errorOutput.str();
|
||||
}
|
||||
|
||||
protected:
|
||||
/// Prints source name if location is given.
|
||||
void printSourceName(SourceReference const& _ref);
|
||||
private:
|
||||
util::AnsiColorized normalColored() const;
|
||||
util::AnsiColorized frameColored() const;
|
||||
util::AnsiColorized errorColored() const;
|
||||
util::AnsiColorized messageColored() const;
|
||||
util::AnsiColorized secondaryColored() const;
|
||||
util::AnsiColorized highlightColored() const;
|
||||
util::AnsiColorized diagColored() const;
|
||||
|
||||
private:
|
||||
std::ostream& m_stream;
|
||||
bool m_colored;
|
||||
bool m_withErrorIds;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,173 +0,0 @@
|
||||
/*
|
||||
This file is part of solidity.
|
||||
|
||||
solidity is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
solidity is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with solidity. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
/**
|
||||
* Formatting functions for errors referencing positions and locations in the source.
|
||||
*/
|
||||
|
||||
#include <liblangutil/SourceReferenceFormatterHuman.h>
|
||||
#include <liblangutil/Scanner.h>
|
||||
#include <liblangutil/Exceptions.h>
|
||||
#include <libsolutil/UTF8.h>
|
||||
#include <iomanip>
|
||||
#include <string_view>
|
||||
|
||||
using namespace std;
|
||||
using namespace solidity;
|
||||
using namespace solidity::langutil;
|
||||
using namespace solidity::util;
|
||||
using namespace solidity::util::formatting;
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
std::string replaceNonTabs(std::string_view _utf8Input, char _filler)
|
||||
{
|
||||
std::string output;
|
||||
for (char const c: _utf8Input)
|
||||
if ((c & 0xc0) != 0x80)
|
||||
output.push_back(c == '\t' ? '\t' : _filler);
|
||||
return output;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
AnsiColorized SourceReferenceFormatterHuman::normalColored() const
|
||||
{
|
||||
return AnsiColorized(m_stream, m_colored, {WHITE});
|
||||
}
|
||||
|
||||
AnsiColorized SourceReferenceFormatterHuman::frameColored() const
|
||||
{
|
||||
return AnsiColorized(m_stream, m_colored, {BOLD, BLUE});
|
||||
}
|
||||
|
||||
AnsiColorized SourceReferenceFormatterHuman::errorColored() const
|
||||
{
|
||||
return AnsiColorized(m_stream, m_colored, {BOLD, RED});
|
||||
}
|
||||
|
||||
AnsiColorized SourceReferenceFormatterHuman::messageColored() const
|
||||
{
|
||||
return AnsiColorized(m_stream, m_colored, {BOLD, WHITE});
|
||||
}
|
||||
|
||||
AnsiColorized SourceReferenceFormatterHuman::secondaryColored() const
|
||||
{
|
||||
return AnsiColorized(m_stream, m_colored, {BOLD, CYAN});
|
||||
}
|
||||
|
||||
AnsiColorized SourceReferenceFormatterHuman::highlightColored() const
|
||||
{
|
||||
return AnsiColorized(m_stream, m_colored, {YELLOW});
|
||||
}
|
||||
|
||||
AnsiColorized SourceReferenceFormatterHuman::diagColored() const
|
||||
{
|
||||
return AnsiColorized(m_stream, m_colored, {BOLD, YELLOW});
|
||||
}
|
||||
|
||||
void SourceReferenceFormatterHuman::printSourceLocation(SourceReference const& _ref)
|
||||
{
|
||||
if (_ref.sourceName.empty())
|
||||
return; // Nothing we can print here
|
||||
|
||||
if (_ref.position.line < 0)
|
||||
{
|
||||
frameColored() << "-->";
|
||||
m_stream << ' ' << _ref.sourceName << '\n';
|
||||
return; // No line available, nothing else to print
|
||||
}
|
||||
|
||||
string line = std::to_string(_ref.position.line + 1); // one-based line number as string
|
||||
string leftpad = string(line.size(), ' ');
|
||||
|
||||
// line 0: source name
|
||||
m_stream << leftpad;
|
||||
frameColored() << "-->";
|
||||
m_stream << ' ' << _ref.sourceName << ':' << line << ':' << (_ref.position.column + 1) << ":\n";
|
||||
|
||||
string_view text = _ref.text;
|
||||
|
||||
if (!_ref.multiline)
|
||||
{
|
||||
size_t const locationLength = static_cast<size_t>(_ref.endColumn - _ref.startColumn);
|
||||
|
||||
// line 1:
|
||||
m_stream << leftpad << ' ';
|
||||
frameColored() << '|';
|
||||
m_stream << '\n';
|
||||
|
||||
// line 2:
|
||||
frameColored() << line << " |";
|
||||
|
||||
m_stream << ' ' << text.substr(0, static_cast<size_t>(_ref.startColumn));
|
||||
highlightColored() << text.substr(static_cast<size_t>(_ref.startColumn), locationLength);
|
||||
m_stream << text.substr(static_cast<size_t>(_ref.endColumn)) << '\n';
|
||||
|
||||
// line 3:
|
||||
m_stream << leftpad << ' ';
|
||||
frameColored() << '|';
|
||||
|
||||
m_stream << ' ' << replaceNonTabs(text.substr(0, static_cast<size_t>(_ref.startColumn)), ' ');
|
||||
diagColored() << (
|
||||
locationLength == 0 ?
|
||||
"^" :
|
||||
replaceNonTabs(text.substr(static_cast<size_t>(_ref.startColumn), locationLength), '^')
|
||||
);
|
||||
m_stream << '\n';
|
||||
}
|
||||
else
|
||||
{
|
||||
// line 1:
|
||||
m_stream << leftpad << ' ';
|
||||
frameColored() << '|';
|
||||
m_stream << '\n';
|
||||
|
||||
// line 2:
|
||||
frameColored() << line << " |";
|
||||
m_stream << ' ' << text.substr(0, static_cast<size_t>(_ref.startColumn));
|
||||
highlightColored() << text.substr(static_cast<size_t>(_ref.startColumn)) << '\n';
|
||||
|
||||
// line 3:
|
||||
m_stream << leftpad << ' ';
|
||||
frameColored() << '|';
|
||||
m_stream << ' ' << replaceNonTabs(text.substr(0, static_cast<size_t>(_ref.startColumn)), ' ');
|
||||
diagColored() << "^ (Relevant source part starts here and spans across multiple lines).";
|
||||
m_stream << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
void SourceReferenceFormatterHuman::printExceptionInformation(SourceReferenceExtractor::Message const& _msg)
|
||||
{
|
||||
// exception header line
|
||||
errorColored() << _msg.category;
|
||||
if (m_withErrorIds && _msg.errorId.has_value())
|
||||
errorColored() << " (" << _msg.errorId.value().error << ")";
|
||||
messageColored() << ": " << _msg.primary.message << '\n';
|
||||
|
||||
printSourceLocation(_msg.primary);
|
||||
|
||||
for (auto const& secondary: _msg.secondary)
|
||||
{
|
||||
secondaryColored() << "Note";
|
||||
messageColored() << ":" << (secondary.message.empty() ? "" : (" " + secondary.message)) << '\n';
|
||||
printSourceLocation(secondary);
|
||||
}
|
||||
|
||||
m_stream << '\n';
|
||||
}
|
@ -1,75 +0,0 @@
|
||||
/*
|
||||
This file is part of solidity.
|
||||
|
||||
solidity is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
solidity is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with solidity. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
/**
|
||||
* Formatting functions for errors referencing positions and locations in the source.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <liblangutil/SourceReferenceExtractor.h>
|
||||
#include <liblangutil/SourceReferenceFormatter.h> // SourceReferenceFormatterBase
|
||||
|
||||
#include <libsolutil/AnsiColorized.h>
|
||||
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <functional>
|
||||
|
||||
namespace solidity::langutil
|
||||
{
|
||||
|
||||
class SourceReferenceFormatterHuman: public SourceReferenceFormatter
|
||||
{
|
||||
public:
|
||||
SourceReferenceFormatterHuman(std::ostream& _stream, bool _colored, bool _withErrorIds):
|
||||
SourceReferenceFormatter{_stream}, m_colored{_colored}, m_withErrorIds(_withErrorIds)
|
||||
{}
|
||||
|
||||
void printSourceLocation(SourceReference const& _ref) override;
|
||||
void printExceptionInformation(SourceReferenceExtractor::Message const& _msg) override;
|
||||
using SourceReferenceFormatter::printExceptionInformation;
|
||||
|
||||
static std::string formatExceptionInformation(
|
||||
util::Exception const& _exception,
|
||||
std::string const& _name,
|
||||
bool _colored = false,
|
||||
bool _withErrorIds = false
|
||||
)
|
||||
{
|
||||
std::ostringstream errorOutput;
|
||||
|
||||
SourceReferenceFormatterHuman formatter(errorOutput, _colored, _withErrorIds);
|
||||
formatter.printExceptionInformation(_exception, _name);
|
||||
return errorOutput.str();
|
||||
}
|
||||
|
||||
private:
|
||||
util::AnsiColorized normalColored() const;
|
||||
util::AnsiColorized frameColored() const;
|
||||
util::AnsiColorized errorColored() const;
|
||||
util::AnsiColorized messageColored() const;
|
||||
util::AnsiColorized secondaryColored() const;
|
||||
util::AnsiColorized highlightColored() const;
|
||||
util::AnsiColorized diagColored() const;
|
||||
|
||||
private:
|
||||
bool m_colored;
|
||||
bool m_withErrorIds;
|
||||
};
|
||||
|
||||
}
|
@ -117,6 +117,7 @@ Json::Value formatErrorWithException(
|
||||
)
|
||||
{
|
||||
string message;
|
||||
// TODO: consider enabling color
|
||||
string formattedMessage = SourceReferenceFormatter::formatExceptionInformation(_exception, _type);
|
||||
|
||||
if (string const* description = boost::get_error_info<util::errinfo_comment>(_exception))
|
||||
|
@ -46,7 +46,6 @@
|
||||
#include <liblangutil/Exceptions.h>
|
||||
#include <liblangutil/Scanner.h>
|
||||
#include <liblangutil/SourceReferenceFormatter.h>
|
||||
#include <liblangutil/SourceReferenceFormatterHuman.h>
|
||||
|
||||
#include <libsmtutil/Exceptions.h>
|
||||
|
||||
@ -189,7 +188,6 @@ static string const g_strIgnoreMissingFiles = "ignore-missing";
|
||||
static string const g_strColor = "color";
|
||||
static string const g_strNoColor = "no-color";
|
||||
static string const g_strErrorIds = "error-codes";
|
||||
static string const g_strOldReporter = "old-reporter";
|
||||
|
||||
static string const g_argAbi = g_strAbi;
|
||||
static string const g_argPrettyJson = g_strPrettyJson;
|
||||
@ -238,7 +236,6 @@ static string const g_argIgnoreMissingFiles = g_strIgnoreMissingFiles;
|
||||
static string const g_argColor = g_strColor;
|
||||
static string const g_argNoColor = g_strNoColor;
|
||||
static string const g_argErrorIds = g_strErrorIds;
|
||||
static string const g_argOldReporter = g_strOldReporter;
|
||||
|
||||
/// Possible arguments to for --combined-json
|
||||
static set<string> const g_combinedJsonArgs
|
||||
@ -939,10 +936,6 @@ General Information)").c_str(),
|
||||
g_argErrorIds.c_str(),
|
||||
"Output error codes."
|
||||
)
|
||||
(
|
||||
g_argOldReporter.c_str(),
|
||||
"Enables old diagnostics reporter (legacy option, will be removed)."
|
||||
)
|
||||
;
|
||||
desc.add(outputFormatting);
|
||||
|
||||
@ -1454,11 +1447,7 @@ bool CommandLineInterface::processInput()
|
||||
|
||||
m_compiler = make_unique<CompilerStack>(fileReader);
|
||||
|
||||
unique_ptr<SourceReferenceFormatter> formatter;
|
||||
if (m_args.count(g_argOldReporter))
|
||||
formatter = make_unique<SourceReferenceFormatter>(serr(false));
|
||||
else
|
||||
formatter = make_unique<SourceReferenceFormatterHuman>(serr(false), m_coloredOutput, m_withErrorIds);
|
||||
SourceReferenceFormatter formatter(serr(false), m_coloredOutput, m_withErrorIds);
|
||||
|
||||
try
|
||||
{
|
||||
@ -1518,7 +1507,7 @@ bool CommandLineInterface::processInput()
|
||||
if (!m_compiler->analyze())
|
||||
{
|
||||
for (auto const& error: m_compiler->errors())
|
||||
formatter->printErrorInformation(*error);
|
||||
formatter.printErrorInformation(*error);
|
||||
astAssert(false, "Analysis of the AST failed");
|
||||
}
|
||||
}
|
||||
@ -1540,7 +1529,7 @@ bool CommandLineInterface::processInput()
|
||||
for (auto const& error: m_compiler->errors())
|
||||
{
|
||||
g_hasOutput = true;
|
||||
formatter->printErrorInformation(*error);
|
||||
formatter.printErrorInformation(*error);
|
||||
}
|
||||
|
||||
if (!successful)
|
||||
@ -1554,7 +1543,7 @@ bool CommandLineInterface::processInput()
|
||||
catch (CompilerError const& _exception)
|
||||
{
|
||||
g_hasOutput = true;
|
||||
formatter->printExceptionInformation(_exception, "Compiler error");
|
||||
formatter.printExceptionInformation(_exception, "Compiler error");
|
||||
return false;
|
||||
}
|
||||
catch (InternalCompilerError const& _exception)
|
||||
@ -1588,7 +1577,7 @@ bool CommandLineInterface::processInput()
|
||||
else
|
||||
{
|
||||
g_hasOutput = true;
|
||||
formatter->printExceptionInformation(_error, _error.typeName());
|
||||
formatter.printExceptionInformation(_error, _error.typeName());
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -1883,16 +1872,12 @@ bool CommandLineInterface::assemble(
|
||||
for (auto const& sourceAndStack: assemblyStacks)
|
||||
{
|
||||
auto const& stack = sourceAndStack.second;
|
||||
unique_ptr<SourceReferenceFormatter> formatter;
|
||||
if (m_args.count(g_argOldReporter))
|
||||
formatter = make_unique<SourceReferenceFormatter>(serr(false));
|
||||
else
|
||||
formatter = make_unique<SourceReferenceFormatterHuman>(serr(false), m_coloredOutput, m_withErrorIds);
|
||||
SourceReferenceFormatter formatter(serr(false), m_coloredOutput, m_withErrorIds);
|
||||
|
||||
for (auto const& error: stack.errors())
|
||||
{
|
||||
g_hasOutput = true;
|
||||
formatter->printErrorInformation(*error);
|
||||
formatter.printErrorInformation(*error);
|
||||
}
|
||||
if (!Error::containsOnlyWarnings(stack.errors()))
|
||||
successful = false;
|
||||
|
@ -2,10 +2,10 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"a.sol": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A1 { function a(uint x) public pure { assert(x > 0); } } contract A2 { function a(uint x) public pure { assert(x > 0); } }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A1 { function a(uint x) public pure { assert(x > 0); } } contract A2 { function a(uint x) public pure { assert(x > 0); } }"
|
||||
},
|
||||
"b.sol": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A1 { function b(uint x) public { assert(x > 0); } } contract B2 { function b(uint x) public pure { assert(x > 0); } }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A1 { function b(uint x) public pure { assert(x > 0); } } contract B2 { function b(uint x) public pure { assert(x > 0); } }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -1,6 +1 @@
|
||||
{"contracts":{"a.sol":{"A1":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}}}},"b.sol":{"A1":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version!
|
||||
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"a.sol","start":-1},"type":"Warning"},{"component":"general","errorCode":"3420","formattedMessage":"b.sol: Warning: Source file does not specify required compiler version!
|
||||
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"b.sol","start":-1},"type":"Warning"},{"component":"general","errorCode":"2018","formattedMessage":"b.sol:2:15: Warning: Function state mutability can be restricted to pure
|
||||
contract A1 { function b(uint x) public { assert(x > 0); } } contract B2 { function b(uint x) public pure { assert(x > 0); } }
|
||||
^------------------------------------------^
|
||||
","message":"Function state mutability can be restricted to pure","severity":"warning","sourceLocation":{"end":93,"file":"b.sol","start":49},"type":"Warning"}],"sources":{"a.sol":{"id":0},"b.sol":{"id":1}}}
|
||||
{"contracts":{"a.sol":{"A1":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}}}},"b.sol":{"A1":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}}}}},"sources":{"a.sol":{"id":0},"b.sol":{"id":1}}}
|
||||
|
@ -2,10 +2,10 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"a.sol": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A1 { function a(uint x) public pure { assert(x > 0); } } contract A2 { function a(uint x) public pure { assert(x > 0); } }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A1 { function a(uint x) public pure { assert(x > 0); } } contract A2 { function a(uint x) public pure { assert(x > 0); } }"
|
||||
},
|
||||
"b.sol": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A1 { function b(uint x) public { assert(x > 0); } } contract B2 { function b(uint x) public pure { assert(x > 0); } }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A1 { function b(uint x) public pure { assert(x > 0); } } contract B2 { function b(uint x) public pure { assert(x > 0); } }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -1,6 +1 @@
|
||||
{"contracts":{"a.sol":{"A2":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version!
|
||||
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"a.sol","start":-1},"type":"Warning"},{"component":"general","errorCode":"3420","formattedMessage":"b.sol: Warning: Source file does not specify required compiler version!
|
||||
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"b.sol","start":-1},"type":"Warning"},{"component":"general","errorCode":"2018","formattedMessage":"b.sol:2:15: Warning: Function state mutability can be restricted to pure
|
||||
contract A1 { function b(uint x) public { assert(x > 0); } } contract B2 { function b(uint x) public pure { assert(x > 0); } }
|
||||
^------------------------------------------^
|
||||
","message":"Function state mutability can be restricted to pure","severity":"warning","sourceLocation":{"end":93,"file":"b.sol","start":49},"type":"Warning"}],"sources":{"a.sol":{"id":0},"b.sol":{"id":1}}}
|
||||
{"contracts":{"a.sol":{"A2":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}}}}},"sources":{"a.sol":{"id":0},"b.sol":{"id":1}}}
|
||||
|
@ -2,10 +2,10 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"a.sol": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A1 { function a(uint x) public pure { assert(x > 0); } } contract A2 { function a(uint x) public pure { assert(x > 0); } }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A1 { function a(uint x) public pure { assert(x > 0); } } contract A2 { function a(uint x) public pure { assert(x > 0); } }"
|
||||
},
|
||||
"b.sol": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A1 { function b(uint x) public { assert(x > 0); } } contract B2 { function b(uint x) public pure { assert(x > 0); } }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A1 { function b(uint x) public pure { assert(x > 0); } } contract B2 { function b(uint x) public pure { assert(x > 0); } }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -1,6 +1 @@
|
||||
{"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version!
|
||||
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"a.sol","start":-1},"type":"Warning"},{"component":"general","errorCode":"3420","formattedMessage":"b.sol: Warning: Source file does not specify required compiler version!
|
||||
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"b.sol","start":-1},"type":"Warning"},{"component":"general","errorCode":"2018","formattedMessage":"b.sol:2:15: Warning: Function state mutability can be restricted to pure
|
||||
contract A1 { function b(uint x) public { assert(x > 0); } } contract B2 { function b(uint x) public pure { assert(x > 0); } }
|
||||
^------------------------------------------^
|
||||
","message":"Function state mutability can be restricted to pure","severity":"warning","sourceLocation":{"end":93,"file":"b.sol","start":49},"type":"Warning"}],"sources":{"a.sol":{"id":0},"b.sol":{"id":1}}}
|
||||
{"sources":{"a.sol":{"id":0},"b.sol":{"id":1}}}
|
||||
|
@ -2,10 +2,10 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"a.sol": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A1 { function a(uint x) public pure { assert(x > 0); } } contract A2 { function a(uint x) public pure { assert(x > 0); } }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A1 { function a(uint x) public pure { assert(x > 0); } } contract A2 { function a(uint x) public pure { assert(x > 0); } }"
|
||||
},
|
||||
"b.sol": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A1 { function b(uint x) public { assert(x > 0); } } contract B2 { function b(uint x) public pure { assert(x > 0); } }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A1 { function b(uint x) public pure { assert(x > 0); } } contract B2 { function b(uint x) public pure { assert(x > 0); } }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -1,6 +1 @@
|
||||
{"contracts":{"a.sol":{"A1":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}}},"A2":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}}}},"b.sol":{"A1":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}}},"B2":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version!
|
||||
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"a.sol","start":-1},"type":"Warning"},{"component":"general","errorCode":"3420","formattedMessage":"b.sol: Warning: Source file does not specify required compiler version!
|
||||
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"b.sol","start":-1},"type":"Warning"},{"component":"general","errorCode":"2018","formattedMessage":"b.sol:2:15: Warning: Function state mutability can be restricted to pure
|
||||
contract A1 { function b(uint x) public { assert(x > 0); } } contract B2 { function b(uint x) public pure { assert(x > 0); } }
|
||||
^------------------------------------------^
|
||||
","message":"Function state mutability can be restricted to pure","severity":"warning","sourceLocation":{"end":93,"file":"b.sol","start":49},"type":"Warning"}],"sources":{"a.sol":{"id":0},"b.sol":{"id":1}}}
|
||||
{"contracts":{"a.sol":{"A1":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}}},"A2":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}}}},"b.sol":{"A1":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}}},"B2":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}}}}},"sources":{"a.sol":{"id":0},"b.sol":{"id":1}}}
|
||||
|
@ -2,10 +2,10 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"a.sol": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A1 { function a(uint x) public pure { assert(x > 0); } } contract A2 { function a(uint x) public pure { assert(x > 0); } }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A1 { function a(uint x) public pure { assert(x > 0); } } contract A2 { function a(uint x) public pure { assert(x > 0); } }"
|
||||
},
|
||||
"b.sol": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A1 { function b(uint x) public { assert(x > 0); } } contract B2 { function b(uint x) public pure { assert(x > 0); } }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A1 { function b(uint x) public pure { assert(x > 0); } } contract B2 { function b(uint x) public pure { assert(x > 0); } }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -1,2 +1 @@
|
||||
{"contracts":{"a.sol":{"A1":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version!
|
||||
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"a.sol","start":-1},"type":"Warning"}],"sources":{"a.sol":{"id":0},"b.sol":{"id":1}}}
|
||||
{"contracts":{"a.sol":{"A1":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}}}}},"sources":{"a.sol":{"id":0},"b.sol":{"id":1}}}
|
||||
|
@ -2,10 +2,10 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"a.sol": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A1 { function a(uint x) public pure { assert(x > 0); } } contract A2 { function a(uint x) public pure { assert(x > 0); } }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A1 { function a(uint x) public pure { assert(x > 0); } } contract A2 { function a(uint x) public pure { assert(x > 0); } }"
|
||||
},
|
||||
"b.sol": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A1 { function b(uint x) public { assert(x > 0); } } contract B2 { function b(uint x) public pure { assert(x > 0); } }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A1 { function b(uint x) public pure { assert(x > 0); } } contract B2 { function b(uint x) public pure { assert(x > 0); } }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -1,5 +1 @@
|
||||
{"contracts":{"b.sol":{"B2":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"b.sol: Warning: Source file does not specify required compiler version!
|
||||
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"b.sol","start":-1},"type":"Warning"},{"component":"general","errorCode":"2018","formattedMessage":"b.sol:2:15: Warning: Function state mutability can be restricted to pure
|
||||
contract A1 { function b(uint x) public { assert(x > 0); } } contract B2 { function b(uint x) public pure { assert(x > 0); } }
|
||||
^------------------------------------------^
|
||||
","message":"Function state mutability can be restricted to pure","severity":"warning","sourceLocation":{"end":93,"file":"b.sol","start":49},"type":"Warning"}],"sources":{"a.sol":{"id":0},"b.sol":{"id":1}}}
|
||||
{"contracts":{"b.sol":{"B2":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}}}}},"sources":{"a.sol":{"id":0},"b.sol":{"id":1}}}
|
||||
|
@ -2,10 +2,10 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"a.sol": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A1 { function a(uint x) public pure { assert(x > 0); } } contract A2 { function a(uint x) public pure { assert(x > 0); } }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A1 { function a(uint x) public pure { assert(x > 0); } } contract A2 { function a(uint x) public pure { assert(x > 0); } }"
|
||||
},
|
||||
"b.sol": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A1 { function b(uint x) public { assert(x > 0); } } contract B2 { function b(uint x) public pure { assert(x > 0); } }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A1 { function b(uint x) public pure { assert(x > 0); } } contract B2 { function b(uint x) public pure { assert(x > 0); } }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -1,2 +1 @@
|
||||
{"contracts":{"a.sol":{"A1":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}}},"A2":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version!
|
||||
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"a.sol","start":-1},"type":"Warning"}],"sources":{"a.sol":{"id":0},"b.sol":{"id":1}}}
|
||||
{"contracts":{"a.sol":{"A1":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}}},"A2":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}}}}},"sources":{"a.sol":{"id":0},"b.sol":{"id":1}}}
|
||||
|
@ -1,7 +1,13 @@
|
||||
{"errors":[{"component":"general","errorCode":"3546","formattedMessage":"A:2:58: ParserError: Expected type name
|
||||
pragma solidity >=0.0; contract Errort6 { using foo for ; /* missing type name */ }
|
||||
^
|
||||
","message":"Expected type name","severity":"error","sourceLocation":{"end":94,"file":"A","start":93},"type":"ParserError"},{"component":"general","errorCode":"3796","formattedMessage":"A:2:84: Warning: Recovered in ContractDefinition at '}'.
|
||||
pragma solidity >=0.0; contract Errort6 { using foo for ; /* missing type name */ }
|
||||
^
|
||||
{"errors":[{"component":"general","errorCode":"3546","formattedMessage":"ParserError: Expected type name
|
||||
--> A:2:58:
|
||||
|
|
||||
2 | pragma solidity >=0.0; contract Errort6 { using foo for ; /* missing type name */ }
|
||||
| ^
|
||||
|
||||
","message":"Expected type name","severity":"error","sourceLocation":{"end":94,"file":"A","start":93},"type":"ParserError"},{"component":"general","errorCode":"3796","formattedMessage":"Warning: Recovered in ContractDefinition at '}'.
|
||||
--> A:2:84:
|
||||
|
|
||||
2 | pragma solidity >=0.0; contract Errort6 { using foo for ; /* missing type name */ }
|
||||
| ^
|
||||
|
||||
","message":"Recovered in ContractDefinition at '}'.","severity":"warning","sourceLocation":{"end":120,"file":"A","start":119},"type":"Warning"}],"sources":{"A":{"ast":{"absolutePath":"A","exportedSymbols":{"Errort6":[3]},"id":4,"license":"GPL-3.0","nodeType":"SourceUnit","nodes":[{"id":1,"literals":["solidity",">=","0.0"],"nodeType":"PragmaDirective","src":"36:22:0"},{"abstract":false,"baseContracts":[],"contractDependencies":[],"contractKind":"contract","fullyImplemented":true,"id":3,"linearizedBaseContracts":[3],"name":"Errort6","nodeType":"ContractDefinition","nodes":[],"scope":4,"src":"59:35:0"}],"src":"36:84:0"},"id":0}}}
|
||||
|
@ -1,4 +1,3 @@
|
||||
{"errors":[{"component":"general","errorCode":"2904","formattedMessage":":2:24: DeclarationError: Declaration \"A\" not found in \"\" (referenced as \".\").
|
||||
pragma solidity >=0.0; import {A} from \".\";
|
||||
^------------------^
|
||||
{"errors":[{"component":"general","errorCode":"2904","formattedMessage":"DeclarationError: Declaration \"A\" not found in \"\" (referenced as \".\").
|
||||
|
||||
","message":"Declaration \"A\" not found in \"\" (referenced as \".\").","severity":"error","type":"DeclarationError"}],"sources":{"":{"id":0}}}
|
||||
|
@ -84,5 +84,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
","id":1,"language":"Yul","name":"#utility.yul"}],"immutableReferences":{},"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"56:74:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;69:59;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;116:7;69:59;;;:::o;24:622:1:-;;145:80;160:64;217:6;160:64;:::i;:::-;145:80;:::i;:::-;136:89;;245:5;273:6;266:5;259:21;299:4;292:5;288:16;281:23;;324:6;374:3;366:4;358:6;354:17;349:3;345:27;342:36;339:2;;;391:1;388;381:12;339:2;419:1;404:236;429:6;426:1;423:13;404:236;;;496:3;524:37;557:3;545:10;524:37;:::i;:::-;519:3;512:50;591:4;586:3;582:14;575:21;;625:4;620:3;616:14;609:21;;464:176;451:1;448;444:9;439:14;;404:236;;;408:14;126:520;;;;;;;:::o;669:303::-;;789:3;782:4;774:6;770:17;766:27;756:2;;807:1;804;797:12;756:2;847:6;834:20;872:94;962:3;954:6;947:4;939:6;935:17;872:94;:::i;:::-;863:103;;746:226;;;;;:::o;978:139::-;;1062:6;1049:20;1040:29;;1078:33;1105:5;1078:33;:::i;:::-;1030:87;;;;:::o;1123:403::-;;1256:2;1244:9;1235:7;1231:23;1227:32;1224:2;;;1272:1;1269;1262:12;1224:2;1342:1;1331:9;1327:17;1314:31;1372:18;1364:6;1361:30;1358:2;;;1404:1;1401;1394:12;1358:2;1431:78;1501:7;1492:6;1481:9;1477:22;1431:78;:::i;:::-;1421:88;;1286:233;1214:312;;;;:::o;1532:118::-;1619:24;1637:5;1619:24;:::i;:::-;1614:3;1607:37;1597:53;;:::o;1656:222::-;;1787:2;1776:9;1772:18;1764:26;;1800:71;1868:1;1857:9;1853:17;1844:6;1800:71;:::i;:::-;1754:124;;;;:::o;1884:283::-;;1950:2;1944:9;1934:19;;1992:4;1984:6;1980:17;2099:6;2087:10;2084:22;2063:18;2051:10;2048:34;2045:62;2042:2;;;2110:18;;:::i;:::-;2042:2;2150:10;2146:2;2139:22;1924:243;;;;:::o;2173:311::-;;2340:18;2332:6;2329:30;2326:2;;;2362:18;;:::i;:::-;2326:2;2412:4;2404:6;2400:17;2392:25;;2472:4;2466;2462:15;2454:23;;2255:229;;;:::o;2490:77::-;;2556:5;2545:16;;2535:32;;;:::o;2573:180::-;2621:77;2618:1;2611:88;2718:4;2715:1;2708:15;2742:4;2739:1;2732:15;2759:122;2832:24;2850:5;2832:24;:::i;:::-;2825:5;2822:35;2812:2;;2871:1;2868;2861:12;2812:2;2802:79;:::o"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version!
|
||||
","id":1,"language":"Yul","name":"#utility.yul"}],"immutableReferences":{},"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"56:74:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;69:59;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;116:7;69:59;;;:::o;24:622:1:-;;145:80;160:64;217:6;160:64;:::i;:::-;145:80;:::i;:::-;136:89;;245:5;273:6;266:5;259:21;299:4;292:5;288:16;281:23;;324:6;374:3;366:4;358:6;354:17;349:3;345:27;342:36;339:2;;;391:1;388;381:12;339:2;419:1;404:236;429:6;426:1;423:13;404:236;;;496:3;524:37;557:3;545:10;524:37;:::i;:::-;519:3;512:50;591:4;586:3;582:14;575:21;;625:4;620:3;616:14;609:21;;464:176;451:1;448;444:9;439:14;;404:236;;;408:14;126:520;;;;;;;:::o;669:303::-;;789:3;782:4;774:6;770:17;766:27;756:2;;807:1;804;797:12;756:2;847:6;834:20;872:94;962:3;954:6;947:4;939:6;935:17;872:94;:::i;:::-;863:103;;746:226;;;;;:::o;978:139::-;;1062:6;1049:20;1040:29;;1078:33;1105:5;1078:33;:::i;:::-;1030:87;;;;:::o;1123:403::-;;1256:2;1244:9;1235:7;1231:23;1227:32;1224:2;;;1272:1;1269;1262:12;1224:2;1342:1;1331:9;1327:17;1314:31;1372:18;1364:6;1361:30;1358:2;;;1404:1;1401;1394:12;1358:2;1431:78;1501:7;1492:6;1481:9;1477:22;1431:78;:::i;:::-;1421:88;;1286:233;1214:312;;;;:::o;1532:118::-;1619:24;1637:5;1619:24;:::i;:::-;1614:3;1607:37;1597:53;;:::o;1656:222::-;;1787:2;1776:9;1772:18;1764:26;;1800:71;1868:1;1857:9;1853:17;1844:6;1800:71;:::i;:::-;1754:124;;;;:::o;1884:283::-;;1950:2;1944:9;1934:19;;1992:4;1984:6;1980:17;2099:6;2087:10;2084:22;2063:18;2051:10;2048:34;2045:62;2042:2;;;2110:18;;:::i;:::-;2042:2;2150:10;2146:2;2139:22;1924:243;;;;:::o;2173:311::-;;2340:18;2332:6;2329:30;2326:2;;;2362:18;;:::i;:::-;2326:2;2412:4;2404:6;2400:17;2392:25;;2472:4;2466;2462:15;2454:23;;2255:229;;;:::o;2490:77::-;;2556:5;2545:16;;2535:32;;;:::o;2573:180::-;2621:77;2618:1;2611:88;2718:4;2715:1;2708:15;2742:4;2739:1;2732:15;2759:122;2832:24;2850:5;2832:24;:::i;:::-;2825:5;2822:35;2812:2;;2871:1;2868;2861:12;2812:2;2802:79;:::o"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"Warning: Source file does not specify required compiler version!
|
||||
--> a.sol
|
||||
|
||||
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"a.sol","start":-1},"type":"Warning"}],"sources":{"a.sol":{"id":0}}}
|
||||
|
@ -2,7 +2,7 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"a.sol": {
|
||||
"content": "// SPDX-License-Identifier: GPL-3.0\ncontract A { uint256 immutable x = 1 + 3; function f() public pure returns (uint256) { return x; } }"
|
||||
"content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A { uint256 immutable x = 1 + 3; function f() public pure returns (uint256) { return x; } }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -1,2 +1 @@
|
||||
{"contracts":{"a.sol":{"A":{"evm":{"deployedBytecode":{"generatedSources":[],"immutableReferences":{"5":[{"length":32,"start":77}]},"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"36:100:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;78:56;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;112:7;130:1;123:8;;78:56;:::o"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version!
|
||||
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"a.sol","start":-1},"type":"Warning"}],"sources":{"a.sol":{"id":0}}}
|
||||
{"contracts":{"a.sol":{"A":{"evm":{"deployedBytecode":{"generatedSources":[],"immutableReferences":{"6":[{"length":32,"start":77}]},"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"59:100:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;101:56;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;135:7;153:1;146:8;;101:56;:::o"}}}}},"sources":{"a.sol":{"id":0}}}
|
||||
|
@ -1,7 +1,9 @@
|
||||
{"errors":[{"component":"general","errorCode":"6328","formattedMessage":"A:4:47: Warning: CHC: Assertion violation happens here.
|
||||
contract C { function f(uint x) public pure { assert(x > 0); } }
|
||||
^-----------^
|
||||
Counterexample:
|
||||
{"errors":[{"component":"general","errorCode":"6328","formattedMessage":"Warning: CHC: Assertion violation happens here.
|
||||
--> A:4:47:
|
||||
|
|
||||
4 | contract C { function f(uint x) public pure { assert(x > 0); } }
|
||||
| ^^^^^^^^^^^^^
|
||||
Note: Counterexample:
|
||||
|
||||
x = 0
|
||||
|
||||
@ -9,6 +11,7 @@ x = 0
|
||||
Transaction trace:
|
||||
constructor()
|
||||
f(0)
|
||||
|
||||
","message":"CHC: Assertion violation happens here.","secondarySourceLocations":[{"message":"Counterexample:
|
||||
|
||||
x = 0
|
||||
|
@ -20,13 +20,16 @@
|
||||
(assert (= |EVALEXPR_0| x_4_0))
|
||||
(check-sat)
|
||||
(get-value (|EVALEXPR_0| ))
|
||||
"}},"errors":[{"component":"general","errorCode":"4661","formattedMessage":"A:4:47: Warning: BMC: Assertion violation happens here.
|
||||
contract C { function f(uint x) public pure { assert(x > 0); } }
|
||||
^-----------^
|
||||
Counterexample:
|
||||
"}},"errors":[{"component":"general","errorCode":"4661","formattedMessage":"Warning: BMC: Assertion violation happens here.
|
||||
--> A:4:47:
|
||||
|
|
||||
4 | contract C { function f(uint x) public pure { assert(x > 0); } }
|
||||
| ^^^^^^^^^^^^^
|
||||
Note: Counterexample:
|
||||
x = 0
|
||||
|
||||
Callstack:
|
||||
Note: Callstack:
|
||||
Note:
|
||||
|
||||
","message":"BMC: Assertion violation happens here.","secondarySourceLocations":[{"message":"Counterexample:
|
||||
x = 0
|
||||
|
@ -1,7 +1,9 @@
|
||||
{"errors":[{"component":"general","errorCode":"6328","formattedMessage":"A:4:47: Warning: CHC: Assertion violation happens here.
|
||||
contract C { function f(uint x) public pure { assert(x > 0); } }
|
||||
^-----------^
|
||||
Counterexample:
|
||||
{"errors":[{"component":"general","errorCode":"6328","formattedMessage":"Warning: CHC: Assertion violation happens here.
|
||||
--> A:4:47:
|
||||
|
|
||||
4 | contract C { function f(uint x) public pure { assert(x > 0); } }
|
||||
| ^^^^^^^^^^^^^
|
||||
Note: Counterexample:
|
||||
|
||||
x = 0
|
||||
|
||||
@ -9,6 +11,7 @@ x = 0
|
||||
Transaction trace:
|
||||
constructor()
|
||||
f(0)
|
||||
|
||||
","message":"CHC: Assertion violation happens here.","secondarySourceLocations":[{"message":"Counterexample:
|
||||
|
||||
x = 0
|
||||
|
@ -240,11 +240,17 @@
|
||||
|
||||
(assert (and (and (and true true) (and (= expr_30_1 (= expr_28_1 expr_29_0)) (and (= expr_29_0 0) (and (= expr_28_1 (ite (= expr_27_0 0) 0 r_div_mod_16_0)) (and (and (<= 0 r_div_mod_16_0) (or (= expr_27_0 0) (< r_div_mod_16_0 expr_27_0))) (and (= (+ (* d_div_mod_16_0 expr_27_0) r_div_mod_16_0) expr_26_0) (and (= expr_27_0 k_8_0) (and (= expr_26_0 y_6_0) (and (implies (and true true) expr_22_1) (and (= expr_22_1 (= expr_20_1 expr_21_0)) (and (= expr_21_0 0) (and (= expr_20_1 (ite (= expr_19_0 0) 0 r_div_mod_15_0)) (and (and (<= 0 r_div_mod_15_0) (or (= expr_19_0 0) (< r_div_mod_15_0 expr_19_0))) (and (= (+ (* d_div_mod_15_0 expr_19_0) r_div_mod_15_0) expr_18_0) (and (= expr_19_0 k_8_0) (and (= expr_18_0 x_4_0) (and (implies (and true true) expr_14_1) (and (= expr_14_1 (> expr_12_0 expr_13_0)) (and (= expr_13_0 0) (and (= expr_12_0 k_8_0) (and (and (>= k_8_0 0) (<= k_8_0 115792089237316195423570985008687907853269984665640564039457584007913129639935)) (and (and (>= y_6_0 0) (<= y_6_0 115792089237316195423570985008687907853269984665640564039457584007913129639935)) (and (and (>= x_4_0 0) (<= x_4_0 115792089237316195423570985008687907853269984665640564039457584007913129639935)) (and (= r_34_0 0) true)))))))))))))))))))))))) (not expr_30_1)))
|
||||
(check-sat)
|
||||
"}},"errors":[{"component":"general","errorCode":"6328","formattedMessage":"A:6:85: Warning: CHC: Assertion violation might happen here.
|
||||
require(k > 0); require(x % k == 0); require(y % k == 0); uint r = mulmod(x, y, k); assert(r % k == 0);}}
|
||||
^----------------^
|
||||
","message":"CHC: Assertion violation might happen here.","severity":"warning","sourceLocation":{"end":258,"file":"A","start":240},"type":"Warning"},{"component":"general","errorCode":"7812","formattedMessage":"A:6:85: Warning: BMC: Assertion violation might happen here.
|
||||
require(k > 0); require(x % k == 0); require(y % k == 0); uint r = mulmod(x, y, k); assert(r % k == 0);}}
|
||||
^----------------^
|
||||
"}},"errors":[{"component":"general","errorCode":"6328","formattedMessage":"Warning: CHC: Assertion violation might happen here.
|
||||
--> A:6:85:
|
||||
|
|
||||
6 | require(k > 0); require(x % k == 0); require(y % k == 0); uint r = mulmod(x, y, k); assert(r % k == 0);}}
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
","message":"CHC: Assertion violation might happen here.","severity":"warning","sourceLocation":{"end":258,"file":"A","start":240},"type":"Warning"},{"component":"general","errorCode":"7812","formattedMessage":"Warning: BMC: Assertion violation might happen here.
|
||||
--> A:6:85:
|
||||
|
|
||||
6 | require(k > 0); require(x % k == 0); require(y % k == 0); uint r = mulmod(x, y, k); assert(r % k == 0);}}
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
Note:
|
||||
|
||||
","message":"BMC: Assertion violation might happen here.","secondarySourceLocations":[{"message":""}],"severity":"warning","sourceLocation":{"end":258,"file":"A","start":240},"type":"Warning"}],"sources":{"A":{"id":0}}}
|
||||
|
@ -496,8 +496,11 @@
|
||||
(assert (= |EVALEXPR_4| expr_43_0))
|
||||
(check-sat)
|
||||
(get-value (|EVALEXPR_0| |EVALEXPR_1| |EVALEXPR_2| |EVALEXPR_3| |EVALEXPR_4| ))
|
||||
"}},"errors":[{"component":"general","errorCode":"7812","formattedMessage":"A:6:85: Warning: BMC: Assertion violation might happen here.
|
||||
require(k > 0); require(x % k == 0); require(y % k == 0); uint r = mulmod(x, y, k); assert(r % k == 0);}}
|
||||
^----------------^
|
||||
"}},"errors":[{"component":"general","errorCode":"7812","formattedMessage":"Warning: BMC: Assertion violation might happen here.
|
||||
--> A:6:85:
|
||||
|
|
||||
6 | require(k > 0); require(x % k == 0); require(y % k == 0); uint r = mulmod(x, y, k); assert(r % k == 0);}}
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
Note:
|
||||
|
||||
","message":"BMC: Assertion violation might happen here.","secondarySourceLocations":[{"message":""}],"severity":"warning","sourceLocation":{"end":258,"file":"A","start":240},"type":"Warning"}],"sources":{"A":{"id":0}}}
|
||||
|
@ -1,4 +1,7 @@
|
||||
{"errors":[{"component":"general","errorCode":"6328","formattedMessage":"A:6:85: Warning: CHC: Assertion violation might happen here.
|
||||
require(k > 0); require(x % k == 0); require(y % k == 0); uint r = mulmod(x, y, k); assert(r % k == 0);}}
|
||||
^----------------^
|
||||
{"errors":[{"component":"general","errorCode":"6328","formattedMessage":"Warning: CHC: Assertion violation might happen here.
|
||||
--> A:6:85:
|
||||
|
|
||||
6 | require(k > 0); require(x % k == 0); require(y % k == 0); uint r = mulmod(x, y, k); assert(r % k == 0);}}
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
","message":"CHC: Assertion violation might happen here.","severity":"warning","sourceLocation":{"end":258,"file":"A","start":240},"type":"Warning"}],"sources":{"A":{"id":0}}}
|
||||
|
@ -2,7 +2,7 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"a.sol": {
|
||||
"content": "// SPDX-License-Identifier: GPL-3.0\npragma abicoder v2; contract A { function f(uint[] memory) public view returns (uint256) { } }"
|
||||
"content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\npragma abicoder v2; contract A { function f(uint[] memory) public view returns (uint256) { } }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -41,5 +41,4 @@
|
||||
mstore(4, 0x41)
|
||||
revert(0, 0x24)
|
||||
}
|
||||
}","id":1,"language":"Yul","name":"#utility.yul"}],"immutableReferences":{},"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"56:74:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;69:59;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;-1:-1:-1;116:7:0;;69:59::o;14:1158:1:-;;129:2;172;160:9;151:7;147:23;143:32;140:2;;;193:6;185;178:22;140:2;238:9;225:23;267:18;308:2;300:6;297:14;294:2;;;329:6;321;314:22;294:2;372:6;361:9;357:22;347:32;;417:7;410:4;406:2;402:13;398:27;388:2;;444:6;436;429:22;388:2;485;472:16;507:2;503;500:10;497:2;;;513:18;;:::i;:::-;560:2;556;552:11;592:2;586:9;643:2;638;630:6;626:15;622:24;696:6;684:10;681:22;676:2;664:10;661:18;658:46;655:2;;;707:18;;:::i;:::-;743:2;736:22;793:18;;;827:15;;;;-1:-1:-1;862:11:1;;;892;;;888:20;;885:33;-1:-1:-1;882:2:1;;;936:6;928;921:22;882:2;963:6;954:15;;978:163;992:2;989:1;986:9;978:163;;;1049:17;;1037:30;;1010:1;1003:9;;;;;1087:12;;;;1119;;978:163;;;-1:-1:-1;1160:6:1;109:1063;-1:-1:-1;;;;;;;;109:1063:1:o;1177:177::-;1323:25;;;1311:2;1296:18;;1278:76::o;1359:127::-;1420:10;1415:3;1411:20;1408:1;1401:31;1451:4;1448:1;1441:15;1475:4;1472:1;1465:15"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version!
|
||||
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"a.sol","start":-1},"type":"Warning"}],"sources":{"a.sol":{"id":0}}}
|
||||
}","id":1,"language":"Yul","name":"#utility.yul"}],"immutableReferences":{},"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"79:74:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;92:59;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;-1:-1:-1;139:7:0;;92:59::o;14:1158:1:-;;129:2;172;160:9;151:7;147:23;143:32;140:2;;;193:6;185;178:22;140:2;238:9;225:23;267:18;308:2;300:6;297:14;294:2;;;329:6;321;314:22;294:2;372:6;361:9;357:22;347:32;;417:7;410:4;406:2;402:13;398:27;388:2;;444:6;436;429:22;388:2;485;472:16;507:2;503;500:10;497:2;;;513:18;;:::i;:::-;560:2;556;552:11;592:2;586:9;643:2;638;630:6;626:15;622:24;696:6;684:10;681:22;676:2;664:10;661:18;658:46;655:2;;;707:18;;:::i;:::-;743:2;736:22;793:18;;;827:15;;;;-1:-1:-1;862:11:1;;;892;;;888:20;;885:33;-1:-1:-1;882:2:1;;;936:6;928;921:22;882:2;963:6;954:15;;978:163;992:2;989:1;986:9;978:163;;;1049:17;;1037:30;;1010:1;1003:9;;;;;1087:12;;;;1119;;978:163;;;-1:-1:-1;1160:6:1;109:1063;-1:-1:-1;;;;;;;;109:1063:1:o;1177:177::-;1323:25;;;1311:2;1296:18;;1278:76::o;1359:127::-;1420:10;1415:3;1411:20;1408:1;1401:31;1451:4;1448:1;1441:15;1475:4;1472:1;1465:15"}}}}},"sources":{"a.sol":{"id":0}}}
|
||||
|
@ -1,10 +1,17 @@
|
||||
{"errors":[{"component":"general","errorCode":"3364","formattedMessage":"A:2:105: DeclarationError: Base constructor arguments given twice.
|
||||
pragma solidity >=0.0; contract A { constructor(uint) {} } contract B is A(2) { } contract C is A(3) {} contract D is B, C {}
|
||||
^-------------------^
|
||||
A:2:74: First constructor call is here:
|
||||
pragma solidity >=0.0; contract A { constructor(uint) {} } contract B is A(2) { } contract C is A(3) {} contract D is B, C {}
|
||||
^--^
|
||||
A:2:97: Second constructor call is here:
|
||||
pragma solidity >=0.0; contract A { constructor(uint) {} } contract B is A(2) { } contract C is A(3) {} contract D is B, C {}
|
||||
^--^
|
||||
{"errors":[{"component":"general","errorCode":"3364","formattedMessage":"DeclarationError: Base constructor arguments given twice.
|
||||
--> A:2:105:
|
||||
|
|
||||
2 | pragma solidity >=0.0; contract A { constructor(uint) {} } contract B is A(2) { } contract C is A(3) {} contract D is B, C {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
Note: First constructor call is here:
|
||||
--> A:2:74:
|
||||
|
|
||||
2 | pragma solidity >=0.0; contract A { constructor(uint) {} } contract B is A(2) { } contract C is A(3) {} contract D is B, C {}
|
||||
| ^^^^
|
||||
Note: Second constructor call is here:
|
||||
--> A:2:97:
|
||||
|
|
||||
2 | pragma solidity >=0.0; contract A { constructor(uint) {} } contract B is A(2) { } contract C is A(3) {} contract D is B, C {}
|
||||
| ^^^^
|
||||
|
||||
","message":"Base constructor arguments given twice.","secondarySourceLocations":[{"end":112,"file":"A","message":"First constructor call is here:","start":108},{"end":135,"file":"A","message":"Second constructor call is here:","start":131}],"severity":"error","sourceLocation":{"end":160,"file":"A","start":139},"type":"DeclarationError"}],"sources":{}}
|
||||
|
@ -4,7 +4,7 @@
|
||||
{
|
||||
"A":
|
||||
{
|
||||
"content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0; contract C {} contract D { function f() public { C c = new C(); } }"
|
||||
"content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0; contract C {} contract D { function f() public { new C(); } }"
|
||||
}
|
||||
},
|
||||
"settings":
|
||||
|
@ -57,23 +57,23 @@ object \"C_2\" {
|
||||
*******************************************************/
|
||||
|
||||
|
||||
object \"D_15\" {
|
||||
object \"D_12\" {
|
||||
code {
|
||||
mstore(64, 128)
|
||||
if callvalue() { revert(0, 0) }
|
||||
|
||||
constructor_D_15()
|
||||
constructor_D_12()
|
||||
|
||||
codecopy(0, dataoffset(\"D_15_deployed\"), datasize(\"D_15_deployed\"))
|
||||
codecopy(0, dataoffset(\"D_12_deployed\"), datasize(\"D_12_deployed\"))
|
||||
|
||||
return(0, datasize(\"D_15_deployed\"))
|
||||
return(0, datasize(\"D_12_deployed\"))
|
||||
|
||||
function constructor_D_15() {
|
||||
function constructor_D_12() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
object \"D_15_deployed\" {
|
||||
object \"D_12_deployed\" {
|
||||
code {
|
||||
mstore(64, 128)
|
||||
|
||||
@ -87,7 +87,7 @@ object \"D_15\" {
|
||||
// f()
|
||||
if callvalue() { revert(0, 0) }
|
||||
abi_decode_tuple_(4, calldatasize())
|
||||
fun_f_14()
|
||||
fun_f_11()
|
||||
let memPos := allocateMemory(0)
|
||||
let memEnd := abi_encode_tuple__to__fromStack(memPos )
|
||||
return(memPos, sub(memEnd, memPos))
|
||||
@ -120,7 +120,7 @@ object \"D_15\" {
|
||||
memPtr := mload(64)
|
||||
}
|
||||
|
||||
function fun_f_14() {
|
||||
function fun_f_11() {
|
||||
|
||||
let _1 := allocateTemporaryMemory()
|
||||
let _2 := add(_1, datasize(\"C_2\"))
|
||||
@ -128,12 +128,11 @@ object \"D_15\" {
|
||||
datacopy(_1, dataoffset(\"C_2\"), datasize(\"C_2\"))
|
||||
_2 := abi_encode_tuple__to__fromStack(_2)
|
||||
|
||||
let expr_11_address := create(0, _1, sub(_2, _1))
|
||||
let expr_8_address := create(0, _1, sub(_2, _1))
|
||||
|
||||
if iszero(expr_11_address) { revert_forward_1() }
|
||||
if iszero(expr_8_address) { revert_forward_1() }
|
||||
|
||||
releaseTemporaryMemory()
|
||||
let vloc_c_7_address := expr_11_address
|
||||
|
||||
}
|
||||
|
||||
@ -213,7 +212,4 @@ object \"D_15\" {
|
||||
|
||||
}
|
||||
|
||||
"}}},"errors":[{"component":"general","errorCode":"2072","formattedMessage":"A:2:73: Warning: Unused local variable.
|
||||
pragma solidity >=0.0; contract C {} contract D { function f() public { C c = new C(); } }
|
||||
^-^
|
||||
","message":"Unused local variable.","severity":"warning","sourceLocation":{"end":111,"file":"A","start":108},"type":"Warning"}],"sources":{"A":{"id":0}}}
|
||||
"}}},"sources":{"A":{"id":0}}}
|
||||
|
@ -2,7 +2,7 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"fileA": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A { }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A { }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -2,7 +2,7 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"fileA": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A { }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A { }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -2,7 +2,7 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"fileA": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A { }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A { }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -2,7 +2,7 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"fileA": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A { }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A { }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -2,7 +2,7 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"fileA": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A { }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A { }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -2,7 +2,7 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"fileA": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A { }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A { }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -2,7 +2,7 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"fileA": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A { }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A { }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -2,7 +2,7 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"fileA": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A { }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A { }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -1,4 +1,7 @@
|
||||
{"errors":[{"component":"general","formattedMessage":"A:1:51: TypeError: Unknown data object \"NamedObject.\".
|
||||
object \"NamedObject\" { code { let x := dataoffset(\"NamedObject.\") sstore(add(x, 0), 0) } object \"OtherObject\" { code { revert(0, 0) } } }
|
||||
^------------^
|
||||
{"errors":[{"component":"general","formattedMessage":"TypeError: Unknown data object \"NamedObject.\".
|
||||
--> A:1:51:
|
||||
|
|
||||
1 | object \"NamedObject\" { code { let x := dataoffset(\"NamedObject.\") sstore(add(x, 0), 0) } object \"OtherObject\" { code { revert(0, 0) } } }
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
","message":"Unknown data object \"NamedObject.\".","severity":"error","sourceLocation":{"end":64,"file":"A","start":50},"type":"TypeError"}]}
|
||||
|
@ -2,7 +2,7 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"fileA": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A { bytes s1 = \"test\"; bytes s2; }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A { bytes s1 = \"test\"; bytes s2; }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -1,2 +1 @@
|
||||
{"contracts":{"fileA":{"A":{"storageLayout":{"storage":[{"astId":3,"contract":"fileA:A","label":"s1","offset":0,"slot":"0","type":"t_bytes_storage"},{"astId":5,"contract":"fileA:A","label":"s2","offset":0,"slot":"1","type":"t_bytes_storage"}],"types":{"t_bytes_storage":{"encoding":"bytes","label":"bytes","numberOfBytes":"32"}}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"fileA: Warning: Source file does not specify required compiler version!
|
||||
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"fileA","start":-1},"type":"Warning"}],"sources":{"fileA":{"id":0}}}
|
||||
{"contracts":{"fileA":{"A":{"storageLayout":{"storage":[{"astId":4,"contract":"fileA:A","label":"s1","offset":0,"slot":"0","type":"t_bytes_storage"},{"astId":6,"contract":"fileA:A","label":"s2","offset":0,"slot":"1","type":"t_bytes_storage"}],"types":{"t_bytes_storage":{"encoding":"bytes","label":"bytes","numberOfBytes":"32"}}}}}},"sources":{"fileA":{"id":0}}}
|
||||
|
@ -2,7 +2,7 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"fileA": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A { uint[] array1; bool[] array2; }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A { uint[] array1; bool[] array2; }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -1,2 +1 @@
|
||||
{"contracts":{"fileA":{"A":{"storageLayout":{"storage":[{"astId":3,"contract":"fileA:A","label":"array1","offset":0,"slot":"0","type":"t_array(t_uint256)dyn_storage"},{"astId":6,"contract":"fileA:A","label":"array2","offset":0,"slot":"1","type":"t_array(t_bool)dyn_storage"}],"types":{"t_array(t_bool)dyn_storage":{"base":"t_bool","encoding":"dynamic_array","label":"bool[]","numberOfBytes":"32"},"t_array(t_uint256)dyn_storage":{"base":"t_uint256","encoding":"dynamic_array","label":"uint256[]","numberOfBytes":"32"},"t_bool":{"encoding":"inplace","label":"bool","numberOfBytes":"1"},"t_uint256":{"encoding":"inplace","label":"uint256","numberOfBytes":"32"}}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"fileA: Warning: Source file does not specify required compiler version!
|
||||
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"fileA","start":-1},"type":"Warning"}],"sources":{"fileA":{"id":0}}}
|
||||
{"contracts":{"fileA":{"A":{"storageLayout":{"storage":[{"astId":4,"contract":"fileA:A","label":"array1","offset":0,"slot":"0","type":"t_array(t_uint256)dyn_storage"},{"astId":7,"contract":"fileA:A","label":"array2","offset":0,"slot":"1","type":"t_array(t_bool)dyn_storage"}],"types":{"t_array(t_bool)dyn_storage":{"base":"t_bool","encoding":"dynamic_array","label":"bool[]","numberOfBytes":"32"},"t_array(t_uint256)dyn_storage":{"base":"t_uint256","encoding":"dynamic_array","label":"uint256[]","numberOfBytes":"32"},"t_bool":{"encoding":"inplace","label":"bool","numberOfBytes":"1"},"t_uint256":{"encoding":"inplace","label":"uint256","numberOfBytes":"32"}}}}}},"sources":{"fileA":{"id":0}}}
|
||||
|
@ -2,7 +2,7 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"fileA": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A { struct S { uint128 a; uint128 b; uint[2] staticArray; uint[] dynArray; } uint x; uint y; S s; address addr; mapping (uint => mapping (address => bool)) map; uint[] array; string s1; bytes b1; }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A { struct S { uint128 a; uint128 b; uint[2] staticArray; uint[] dynArray; } uint x; uint y; S s; address addr; mapping (uint => mapping (address => bool)) map; uint[] array; string s1; bytes b1; }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -1,2 +1 @@
|
||||
{"contracts":{"fileA":{"A":{"storageLayout":{"storage":[{"astId":14,"contract":"fileA:A","label":"x","offset":0,"slot":"0","type":"t_uint256"},{"astId":16,"contract":"fileA:A","label":"y","offset":0,"slot":"1","type":"t_uint256"},{"astId":19,"contract":"fileA:A","label":"s","offset":0,"slot":"2","type":"t_struct(S)12_storage"},{"astId":21,"contract":"fileA:A","label":"addr","offset":0,"slot":"6","type":"t_address"},{"astId":27,"contract":"fileA:A","label":"map","offset":0,"slot":"7","type":"t_mapping(t_uint256,t_mapping(t_address,t_bool))"},{"astId":30,"contract":"fileA:A","label":"array","offset":0,"slot":"8","type":"t_array(t_uint256)dyn_storage"},{"astId":32,"contract":"fileA:A","label":"s1","offset":0,"slot":"9","type":"t_string_storage"},{"astId":34,"contract":"fileA:A","label":"b1","offset":0,"slot":"10","type":"t_bytes_storage"}],"types":{"t_address":{"encoding":"inplace","label":"address","numberOfBytes":"20"},"t_array(t_uint256)2_storage":{"base":"t_uint256","encoding":"inplace","label":"uint256[2]","numberOfBytes":"64"},"t_array(t_uint256)dyn_storage":{"base":"t_uint256","encoding":"dynamic_array","label":"uint256[]","numberOfBytes":"32"},"t_bool":{"encoding":"inplace","label":"bool","numberOfBytes":"1"},"t_bytes_storage":{"encoding":"bytes","label":"bytes","numberOfBytes":"32"},"t_mapping(t_address,t_bool)":{"encoding":"mapping","key":"t_address","label":"mapping(address => bool)","numberOfBytes":"32","value":"t_bool"},"t_mapping(t_uint256,t_mapping(t_address,t_bool))":{"encoding":"mapping","key":"t_uint256","label":"mapping(uint256 => mapping(address => bool))","numberOfBytes":"32","value":"t_mapping(t_address,t_bool)"},"t_string_storage":{"encoding":"bytes","label":"string","numberOfBytes":"32"},"t_struct(S)12_storage":{"encoding":"inplace","label":"struct A.S","members":[{"astId":2,"contract":"fileA:A","label":"a","offset":0,"slot":"0","type":"t_uint128"},{"astId":4,"contract":"fileA:A","label":"b","offset":16,"slot":"0","type":"t_uint128"},{"astId":8,"contract":"fileA:A","label":"staticArray","offset":0,"slot":"1","type":"t_array(t_uint256)2_storage"},{"astId":11,"contract":"fileA:A","label":"dynArray","offset":0,"slot":"3","type":"t_array(t_uint256)dyn_storage"}],"numberOfBytes":"128"},"t_uint128":{"encoding":"inplace","label":"uint128","numberOfBytes":"16"},"t_uint256":{"encoding":"inplace","label":"uint256","numberOfBytes":"32"}}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"fileA: Warning: Source file does not specify required compiler version!
|
||||
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"fileA","start":-1},"type":"Warning"}],"sources":{"fileA":{"id":0}}}
|
||||
{"contracts":{"fileA":{"A":{"storageLayout":{"storage":[{"astId":15,"contract":"fileA:A","label":"x","offset":0,"slot":"0","type":"t_uint256"},{"astId":17,"contract":"fileA:A","label":"y","offset":0,"slot":"1","type":"t_uint256"},{"astId":20,"contract":"fileA:A","label":"s","offset":0,"slot":"2","type":"t_struct(S)13_storage"},{"astId":22,"contract":"fileA:A","label":"addr","offset":0,"slot":"6","type":"t_address"},{"astId":28,"contract":"fileA:A","label":"map","offset":0,"slot":"7","type":"t_mapping(t_uint256,t_mapping(t_address,t_bool))"},{"astId":31,"contract":"fileA:A","label":"array","offset":0,"slot":"8","type":"t_array(t_uint256)dyn_storage"},{"astId":33,"contract":"fileA:A","label":"s1","offset":0,"slot":"9","type":"t_string_storage"},{"astId":35,"contract":"fileA:A","label":"b1","offset":0,"slot":"10","type":"t_bytes_storage"}],"types":{"t_address":{"encoding":"inplace","label":"address","numberOfBytes":"20"},"t_array(t_uint256)2_storage":{"base":"t_uint256","encoding":"inplace","label":"uint256[2]","numberOfBytes":"64"},"t_array(t_uint256)dyn_storage":{"base":"t_uint256","encoding":"dynamic_array","label":"uint256[]","numberOfBytes":"32"},"t_bool":{"encoding":"inplace","label":"bool","numberOfBytes":"1"},"t_bytes_storage":{"encoding":"bytes","label":"bytes","numberOfBytes":"32"},"t_mapping(t_address,t_bool)":{"encoding":"mapping","key":"t_address","label":"mapping(address => bool)","numberOfBytes":"32","value":"t_bool"},"t_mapping(t_uint256,t_mapping(t_address,t_bool))":{"encoding":"mapping","key":"t_uint256","label":"mapping(uint256 => mapping(address => bool))","numberOfBytes":"32","value":"t_mapping(t_address,t_bool)"},"t_string_storage":{"encoding":"bytes","label":"string","numberOfBytes":"32"},"t_struct(S)13_storage":{"encoding":"inplace","label":"struct A.S","members":[{"astId":3,"contract":"fileA:A","label":"a","offset":0,"slot":"0","type":"t_uint128"},{"astId":5,"contract":"fileA:A","label":"b","offset":16,"slot":"0","type":"t_uint128"},{"astId":9,"contract":"fileA:A","label":"staticArray","offset":0,"slot":"1","type":"t_array(t_uint256)2_storage"},{"astId":12,"contract":"fileA:A","label":"dynArray","offset":0,"slot":"3","type":"t_array(t_uint256)dyn_storage"}],"numberOfBytes":"128"},"t_uint128":{"encoding":"inplace","label":"uint128","numberOfBytes":"16"},"t_uint256":{"encoding":"inplace","label":"uint256","numberOfBytes":"32"}}}}}},"sources":{"fileA":{"id":0}}}
|
||||
|
@ -2,7 +2,7 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"fileA": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A { uint x; uint y; mapping (uint => mapping (address => bool)) map; }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A { uint x; uint y; mapping (uint => mapping (address => bool)) map; }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -1,2 +1 @@
|
||||
{"contracts":{"fileA":{"A":{"storageLayout":{"storage":[{"astId":2,"contract":"fileA:A","label":"x","offset":0,"slot":"0","type":"t_uint256"},{"astId":4,"contract":"fileA:A","label":"y","offset":0,"slot":"1","type":"t_uint256"},{"astId":10,"contract":"fileA:A","label":"map","offset":0,"slot":"2","type":"t_mapping(t_uint256,t_mapping(t_address,t_bool))"}],"types":{"t_address":{"encoding":"inplace","label":"address","numberOfBytes":"20"},"t_bool":{"encoding":"inplace","label":"bool","numberOfBytes":"1"},"t_mapping(t_address,t_bool)":{"encoding":"mapping","key":"t_address","label":"mapping(address => bool)","numberOfBytes":"32","value":"t_bool"},"t_mapping(t_uint256,t_mapping(t_address,t_bool))":{"encoding":"mapping","key":"t_uint256","label":"mapping(uint256 => mapping(address => bool))","numberOfBytes":"32","value":"t_mapping(t_address,t_bool)"},"t_uint256":{"encoding":"inplace","label":"uint256","numberOfBytes":"32"}}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"fileA: Warning: Source file does not specify required compiler version!
|
||||
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"fileA","start":-1},"type":"Warning"}],"sources":{"fileA":{"id":0}}}
|
||||
{"contracts":{"fileA":{"A":{"storageLayout":{"storage":[{"astId":3,"contract":"fileA:A","label":"x","offset":0,"slot":"0","type":"t_uint256"},{"astId":5,"contract":"fileA:A","label":"y","offset":0,"slot":"1","type":"t_uint256"},{"astId":11,"contract":"fileA:A","label":"map","offset":0,"slot":"2","type":"t_mapping(t_uint256,t_mapping(t_address,t_bool))"}],"types":{"t_address":{"encoding":"inplace","label":"address","numberOfBytes":"20"},"t_bool":{"encoding":"inplace","label":"bool","numberOfBytes":"1"},"t_mapping(t_address,t_bool)":{"encoding":"mapping","key":"t_address","label":"mapping(address => bool)","numberOfBytes":"32","value":"t_bool"},"t_mapping(t_uint256,t_mapping(t_address,t_bool))":{"encoding":"mapping","key":"t_uint256","label":"mapping(uint256 => mapping(address => bool))","numberOfBytes":"32","value":"t_mapping(t_address,t_bool)"},"t_uint256":{"encoding":"inplace","label":"uint256","numberOfBytes":"32"}}}}}},"sources":{"fileA":{"id":0}}}
|
||||
|
@ -2,7 +2,7 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"fileA": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A { }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A { }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -1,2 +1 @@
|
||||
{"contracts":{"fileA":{"A":{"storageLayout":{"storage":[],"types":null}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"fileA: Warning: Source file does not specify required compiler version!
|
||||
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"fileA","start":-1},"type":"Warning"}],"sources":{"fileA":{"id":0}}}
|
||||
{"contracts":{"fileA":{"A":{"storageLayout":{"storage":[],"types":null}}}},"sources":{"fileA":{"id":0}}}
|
||||
|
@ -2,10 +2,10 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"fileA": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A { }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A { }"
|
||||
},
|
||||
"fileB": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A { uint x; uint y; }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A { uint x; uint y; }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -1,2 +1 @@
|
||||
{"contracts":{"fileA":{"A":{"storageLayout":{"storage":[],"types":null}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"fileA: Warning: Source file does not specify required compiler version!
|
||||
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"fileA","start":-1},"type":"Warning"}],"sources":{"fileA":{"id":0},"fileB":{"id":1}}}
|
||||
{"contracts":{"fileA":{"A":{"storageLayout":{"storage":[],"types":null}}}},"sources":{"fileA":{"id":0},"fileB":{"id":1}}}
|
||||
|
@ -2,7 +2,7 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"fileA": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A { string s1 = \"test\"; string s2; }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A { string s1 = \"test\"; string s2; }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -1,2 +1 @@
|
||||
{"contracts":{"fileA":{"A":{"storageLayout":{"storage":[{"astId":3,"contract":"fileA:A","label":"s1","offset":0,"slot":"0","type":"t_string_storage"},{"astId":5,"contract":"fileA:A","label":"s2","offset":0,"slot":"1","type":"t_string_storage"}],"types":{"t_string_storage":{"encoding":"bytes","label":"string","numberOfBytes":"32"}}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"fileA: Warning: Source file does not specify required compiler version!
|
||||
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"fileA","start":-1},"type":"Warning"}],"sources":{"fileA":{"id":0}}}
|
||||
{"contracts":{"fileA":{"A":{"storageLayout":{"storage":[{"astId":4,"contract":"fileA:A","label":"s1","offset":0,"slot":"0","type":"t_string_storage"},{"astId":6,"contract":"fileA:A","label":"s2","offset":0,"slot":"1","type":"t_string_storage"}],"types":{"t_string_storage":{"encoding":"bytes","label":"string","numberOfBytes":"32"}}}}}},"sources":{"fileA":{"id":0}}}
|
||||
|
@ -2,7 +2,7 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"fileA": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A { struct S { uint a; uint b; uint[2] staticArray; uint[] dynArray; } uint x; uint y; S s; address addr; }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A { struct S { uint a; uint b; uint[2] staticArray; uint[] dynArray; } uint x; uint y; S s; address addr; }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -1,2 +1 @@
|
||||
{"contracts":{"fileA":{"A":{"storageLayout":{"storage":[{"astId":14,"contract":"fileA:A","label":"x","offset":0,"slot":"0","type":"t_uint256"},{"astId":16,"contract":"fileA:A","label":"y","offset":0,"slot":"1","type":"t_uint256"},{"astId":19,"contract":"fileA:A","label":"s","offset":0,"slot":"2","type":"t_struct(S)12_storage"},{"astId":21,"contract":"fileA:A","label":"addr","offset":0,"slot":"7","type":"t_address"}],"types":{"t_address":{"encoding":"inplace","label":"address","numberOfBytes":"20"},"t_array(t_uint256)2_storage":{"base":"t_uint256","encoding":"inplace","label":"uint256[2]","numberOfBytes":"64"},"t_array(t_uint256)dyn_storage":{"base":"t_uint256","encoding":"dynamic_array","label":"uint256[]","numberOfBytes":"32"},"t_struct(S)12_storage":{"encoding":"inplace","label":"struct A.S","members":[{"astId":2,"contract":"fileA:A","label":"a","offset":0,"slot":"0","type":"t_uint256"},{"astId":4,"contract":"fileA:A","label":"b","offset":0,"slot":"1","type":"t_uint256"},{"astId":8,"contract":"fileA:A","label":"staticArray","offset":0,"slot":"2","type":"t_array(t_uint256)2_storage"},{"astId":11,"contract":"fileA:A","label":"dynArray","offset":0,"slot":"4","type":"t_array(t_uint256)dyn_storage"}],"numberOfBytes":"160"},"t_uint256":{"encoding":"inplace","label":"uint256","numberOfBytes":"32"}}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"fileA: Warning: Source file does not specify required compiler version!
|
||||
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"fileA","start":-1},"type":"Warning"}],"sources":{"fileA":{"id":0}}}
|
||||
{"contracts":{"fileA":{"A":{"storageLayout":{"storage":[{"astId":15,"contract":"fileA:A","label":"x","offset":0,"slot":"0","type":"t_uint256"},{"astId":17,"contract":"fileA:A","label":"y","offset":0,"slot":"1","type":"t_uint256"},{"astId":20,"contract":"fileA:A","label":"s","offset":0,"slot":"2","type":"t_struct(S)13_storage"},{"astId":22,"contract":"fileA:A","label":"addr","offset":0,"slot":"7","type":"t_address"}],"types":{"t_address":{"encoding":"inplace","label":"address","numberOfBytes":"20"},"t_array(t_uint256)2_storage":{"base":"t_uint256","encoding":"inplace","label":"uint256[2]","numberOfBytes":"64"},"t_array(t_uint256)dyn_storage":{"base":"t_uint256","encoding":"dynamic_array","label":"uint256[]","numberOfBytes":"32"},"t_struct(S)13_storage":{"encoding":"inplace","label":"struct A.S","members":[{"astId":3,"contract":"fileA:A","label":"a","offset":0,"slot":"0","type":"t_uint256"},{"astId":5,"contract":"fileA:A","label":"b","offset":0,"slot":"1","type":"t_uint256"},{"astId":9,"contract":"fileA:A","label":"staticArray","offset":0,"slot":"2","type":"t_array(t_uint256)2_storage"},{"astId":12,"contract":"fileA:A","label":"dynArray","offset":0,"slot":"4","type":"t_array(t_uint256)dyn_storage"}],"numberOfBytes":"160"},"t_uint256":{"encoding":"inplace","label":"uint256","numberOfBytes":"32"}}}}}},"sources":{"fileA":{"id":0}}}
|
||||
|
@ -2,7 +2,7 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"fileA": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A { struct S { uint128 a; uint128 b; uint[2] staticArray; uint[] dynArray; } uint x; uint y; S s; address addr; }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A { struct S { uint128 a; uint128 b; uint[2] staticArray; uint[] dynArray; } uint x; uint y; S s; address addr; }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -1,2 +1 @@
|
||||
{"contracts":{"fileA":{"A":{"storageLayout":{"storage":[{"astId":14,"contract":"fileA:A","label":"x","offset":0,"slot":"0","type":"t_uint256"},{"astId":16,"contract":"fileA:A","label":"y","offset":0,"slot":"1","type":"t_uint256"},{"astId":19,"contract":"fileA:A","label":"s","offset":0,"slot":"2","type":"t_struct(S)12_storage"},{"astId":21,"contract":"fileA:A","label":"addr","offset":0,"slot":"6","type":"t_address"}],"types":{"t_address":{"encoding":"inplace","label":"address","numberOfBytes":"20"},"t_array(t_uint256)2_storage":{"base":"t_uint256","encoding":"inplace","label":"uint256[2]","numberOfBytes":"64"},"t_array(t_uint256)dyn_storage":{"base":"t_uint256","encoding":"dynamic_array","label":"uint256[]","numberOfBytes":"32"},"t_struct(S)12_storage":{"encoding":"inplace","label":"struct A.S","members":[{"astId":2,"contract":"fileA:A","label":"a","offset":0,"slot":"0","type":"t_uint128"},{"astId":4,"contract":"fileA:A","label":"b","offset":16,"slot":"0","type":"t_uint128"},{"astId":8,"contract":"fileA:A","label":"staticArray","offset":0,"slot":"1","type":"t_array(t_uint256)2_storage"},{"astId":11,"contract":"fileA:A","label":"dynArray","offset":0,"slot":"3","type":"t_array(t_uint256)dyn_storage"}],"numberOfBytes":"128"},"t_uint128":{"encoding":"inplace","label":"uint128","numberOfBytes":"16"},"t_uint256":{"encoding":"inplace","label":"uint256","numberOfBytes":"32"}}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"fileA: Warning: Source file does not specify required compiler version!
|
||||
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"fileA","start":-1},"type":"Warning"}],"sources":{"fileA":{"id":0}}}
|
||||
{"contracts":{"fileA":{"A":{"storageLayout":{"storage":[{"astId":15,"contract":"fileA:A","label":"x","offset":0,"slot":"0","type":"t_uint256"},{"astId":17,"contract":"fileA:A","label":"y","offset":0,"slot":"1","type":"t_uint256"},{"astId":20,"contract":"fileA:A","label":"s","offset":0,"slot":"2","type":"t_struct(S)13_storage"},{"astId":22,"contract":"fileA:A","label":"addr","offset":0,"slot":"6","type":"t_address"}],"types":{"t_address":{"encoding":"inplace","label":"address","numberOfBytes":"20"},"t_array(t_uint256)2_storage":{"base":"t_uint256","encoding":"inplace","label":"uint256[2]","numberOfBytes":"64"},"t_array(t_uint256)dyn_storage":{"base":"t_uint256","encoding":"dynamic_array","label":"uint256[]","numberOfBytes":"32"},"t_struct(S)13_storage":{"encoding":"inplace","label":"struct A.S","members":[{"astId":3,"contract":"fileA:A","label":"a","offset":0,"slot":"0","type":"t_uint128"},{"astId":5,"contract":"fileA:A","label":"b","offset":16,"slot":"0","type":"t_uint128"},{"astId":9,"contract":"fileA:A","label":"staticArray","offset":0,"slot":"1","type":"t_array(t_uint256)2_storage"},{"astId":12,"contract":"fileA:A","label":"dynArray","offset":0,"slot":"3","type":"t_array(t_uint256)dyn_storage"}],"numberOfBytes":"128"},"t_uint128":{"encoding":"inplace","label":"uint128","numberOfBytes":"16"},"t_uint256":{"encoding":"inplace","label":"uint256","numberOfBytes":"32"}}}}}},"sources":{"fileA":{"id":0}}}
|
||||
|
@ -2,7 +2,7 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"fileA": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A { uint x; uint y; address addr; uint[2] array; }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A { uint x; uint y; address addr; uint[2] array; }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -1,2 +1 @@
|
||||
{"contracts":{"fileA":{"A":{"storageLayout":{"storage":[{"astId":2,"contract":"fileA:A","label":"x","offset":0,"slot":"0","type":"t_uint256"},{"astId":4,"contract":"fileA:A","label":"y","offset":0,"slot":"1","type":"t_uint256"},{"astId":6,"contract":"fileA:A","label":"addr","offset":0,"slot":"2","type":"t_address"},{"astId":10,"contract":"fileA:A","label":"array","offset":0,"slot":"3","type":"t_array(t_uint256)2_storage"}],"types":{"t_address":{"encoding":"inplace","label":"address","numberOfBytes":"20"},"t_array(t_uint256)2_storage":{"base":"t_uint256","encoding":"inplace","label":"uint256[2]","numberOfBytes":"64"},"t_uint256":{"encoding":"inplace","label":"uint256","numberOfBytes":"32"}}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"fileA: Warning: Source file does not specify required compiler version!
|
||||
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"fileA","start":-1},"type":"Warning"}],"sources":{"fileA":{"id":0}}}
|
||||
{"contracts":{"fileA":{"A":{"storageLayout":{"storage":[{"astId":3,"contract":"fileA:A","label":"x","offset":0,"slot":"0","type":"t_uint256"},{"astId":5,"contract":"fileA:A","label":"y","offset":0,"slot":"1","type":"t_uint256"},{"astId":7,"contract":"fileA:A","label":"addr","offset":0,"slot":"2","type":"t_address"},{"astId":11,"contract":"fileA:A","label":"array","offset":0,"slot":"3","type":"t_array(t_uint256)2_storage"}],"types":{"t_address":{"encoding":"inplace","label":"address","numberOfBytes":"20"},"t_array(t_uint256)2_storage":{"base":"t_uint256","encoding":"inplace","label":"uint256[2]","numberOfBytes":"64"},"t_uint256":{"encoding":"inplace","label":"uint256","numberOfBytes":"32"}}}}}},"sources":{"fileA":{"id":0}}}
|
||||
|
@ -2,7 +2,7 @@
|
||||
"language": "Solidity",
|
||||
"sources": {
|
||||
"fileA": {
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\ncontract A { uint64 x; uint128 y; uint128 z; address addr; uint[2] array; }"
|
||||
"content": "//SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.0;\ncontract A { uint64 x; uint128 y; uint128 z; address addr; uint[2] array; }"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
|
@ -1,2 +1 @@
|
||||
{"contracts":{"fileA":{"A":{"storageLayout":{"storage":[{"astId":2,"contract":"fileA:A","label":"x","offset":0,"slot":"0","type":"t_uint64"},{"astId":4,"contract":"fileA:A","label":"y","offset":8,"slot":"0","type":"t_uint128"},{"astId":6,"contract":"fileA:A","label":"z","offset":0,"slot":"1","type":"t_uint128"},{"astId":8,"contract":"fileA:A","label":"addr","offset":0,"slot":"2","type":"t_address"},{"astId":12,"contract":"fileA:A","label":"array","offset":0,"slot":"3","type":"t_array(t_uint256)2_storage"}],"types":{"t_address":{"encoding":"inplace","label":"address","numberOfBytes":"20"},"t_array(t_uint256)2_storage":{"base":"t_uint256","encoding":"inplace","label":"uint256[2]","numberOfBytes":"64"},"t_uint128":{"encoding":"inplace","label":"uint128","numberOfBytes":"16"},"t_uint256":{"encoding":"inplace","label":"uint256","numberOfBytes":"32"},"t_uint64":{"encoding":"inplace","label":"uint64","numberOfBytes":"8"}}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"fileA: Warning: Source file does not specify required compiler version!
|
||||
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"fileA","start":-1},"type":"Warning"}],"sources":{"fileA":{"id":0}}}
|
||||
{"contracts":{"fileA":{"A":{"storageLayout":{"storage":[{"astId":3,"contract":"fileA:A","label":"x","offset":0,"slot":"0","type":"t_uint64"},{"astId":5,"contract":"fileA:A","label":"y","offset":8,"slot":"0","type":"t_uint128"},{"astId":7,"contract":"fileA:A","label":"z","offset":0,"slot":"1","type":"t_uint128"},{"astId":9,"contract":"fileA:A","label":"addr","offset":0,"slot":"2","type":"t_address"},{"astId":13,"contract":"fileA:A","label":"array","offset":0,"slot":"3","type":"t_array(t_uint256)2_storage"}],"types":{"t_address":{"encoding":"inplace","label":"address","numberOfBytes":"20"},"t_array(t_uint256)2_storage":{"base":"t_uint256","encoding":"inplace","label":"uint256[2]","numberOfBytes":"64"},"t_uint128":{"encoding":"inplace","label":"uint128","numberOfBytes":"16"},"t_uint256":{"encoding":"inplace","label":"uint256","numberOfBytes":"32"},"t_uint64":{"encoding":"inplace","label":"uint64","numberOfBytes":"8"}}}}}},"sources":{"fileA":{"id":0}}}
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <test/libsolidity/ASTJSONTest.h>
|
||||
#include <test/Common.h>
|
||||
#include <libsolutil/AnsiColorized.h>
|
||||
#include <liblangutil/SourceReferenceFormatterHuman.h>
|
||||
#include <liblangutil/SourceReferenceFormatter.h>
|
||||
#include <libsolidity/ast/ASTJsonConverter.h>
|
||||
#include <libsolidity/interface/CompilerStack.h>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
@ -141,7 +141,7 @@ TestCase::TestResult ASTJSONTest::run(ostream& _stream, string const& _linePrefi
|
||||
|
||||
if (!c.compile(CompilerStack::State::Parsed))
|
||||
{
|
||||
SourceReferenceFormatterHuman formatter(_stream, _formatted, false);
|
||||
SourceReferenceFormatter formatter(_stream, _formatted, false);
|
||||
for (auto const& error: c.errors())
|
||||
formatter.printErrorInformation(*error);
|
||||
return TestResult::FatalError;
|
||||
@ -167,7 +167,7 @@ TestCase::TestResult ASTJSONTest::run(ostream& _stream, string const& _linePrefi
|
||||
if (m_expectation.empty())
|
||||
return resultsMatch ? TestResult::Success : TestResult::Failure;
|
||||
|
||||
SourceReferenceFormatterHuman formatter(_stream, _formatted, false);
|
||||
SourceReferenceFormatter formatter(_stream, _formatted, false);
|
||||
for (auto const& error: c.errors())
|
||||
formatter.printErrorInformation(*error);
|
||||
return TestResult::FatalError;
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include <libevmasm/PathGasMeter.h>
|
||||
#include <libsolidity/ast/AST.h>
|
||||
#include <libsolidity/interface/GasEstimator.h>
|
||||
#include <liblangutil/SourceReferenceFormatter.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace solidity::langutil;
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <test/Common.h>
|
||||
#include <libsolutil/CommonIO.h>
|
||||
#include <libsolutil/JSON.h>
|
||||
#include <liblangutil/SourceReferenceFormatterHuman.h>
|
||||
#include <liblangutil/SourceReferenceFormatter.h>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
@ -119,7 +119,7 @@ TestCase::TestResult GasTest::run(ostream& _stream, string const& _linePrefix, b
|
||||
|
||||
if (!compiler().parseAndAnalyze() || !compiler().compile())
|
||||
{
|
||||
SourceReferenceFormatterHuman formatter(_stream, _formatted, false);
|
||||
SourceReferenceFormatter formatter(_stream, _formatted, false);
|
||||
for (auto const& error: compiler().errors())
|
||||
formatter.printErrorInformation(*error);
|
||||
return TestResult::FatalError;
|
||||
|
@ -25,6 +25,8 @@
|
||||
#include <iostream>
|
||||
#include <boost/test/framework.hpp>
|
||||
#include <test/libsolidity/SolidityExecutionFramework.h>
|
||||
#include <liblangutil/Exceptions.h>
|
||||
#include <liblangutil/SourceReferenceFormatter.h>
|
||||
|
||||
using namespace solidity;
|
||||
using namespace solidity::test;
|
||||
@ -60,7 +62,7 @@ bytes SolidityExecutionFramework::multiSourceCompileContract(
|
||||
for (auto const& error: m_compiler.errors())
|
||||
if (error->type() == langutil::Error::Type::CodeGenerationError)
|
||||
BOOST_THROW_EXCEPTION(*error);
|
||||
langutil::SourceReferenceFormatter formatter(std::cerr);
|
||||
langutil::SourceReferenceFormatter formatter(std::cerr, true, false);
|
||||
|
||||
for (auto const& error: m_compiler.errors())
|
||||
formatter.printErrorInformation(*error);
|
||||
|
@ -32,9 +32,6 @@
|
||||
|
||||
#include <libyul/AssemblyStack.h>
|
||||
|
||||
#include <liblangutil/Exceptions.h>
|
||||
#include <liblangutil/SourceReferenceFormatter.h>
|
||||
|
||||
namespace solidity::frontend::test
|
||||
{
|
||||
|
||||
|
@ -510,8 +510,8 @@ BOOST_AUTO_TEST_CASE(compilation_error)
|
||||
{
|
||||
BOOST_CHECK_EQUAL(
|
||||
util::jsonCompactPrint(error),
|
||||
"{\"component\":\"general\",\"errorCode\":\"2314\",\"formattedMessage\":\"fileA:1:23: ParserError: Expected identifier but got '}'\\n"
|
||||
"contract A { function }\\n ^\\n\",\"message\":\"Expected identifier but got '}'\","
|
||||
"{\"component\":\"general\",\"errorCode\":\"2314\",\"formattedMessage\":\"ParserError: Expected identifier but got '}'\\n"
|
||||
" --> fileA:1:23:\\n |\\n1 | contract A { function }\\n | ^\\n\\n\",\"message\":\"Expected identifier but got '}'\","
|
||||
"\"severity\":\"error\",\"sourceLocation\":{\"end\":23,\"file\":\"fileA\",\"start\":22},\"type\":\"ParserError\"}"
|
||||
);
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ Dialect const& defaultDialect(bool _yul)
|
||||
|
||||
void yul::test::printErrors(ErrorList const& _errors)
|
||||
{
|
||||
SourceReferenceFormatter formatter(cout);
|
||||
SourceReferenceFormatter formatter(cout, true, false);
|
||||
|
||||
for (auto const& error: _errors)
|
||||
formatter.printErrorInformation(*error);
|
||||
|
@ -116,7 +116,7 @@ string EwasmTranslationTest::interpret()
|
||||
|
||||
void EwasmTranslationTest::printErrors(ostream& _stream, ErrorList const& _errors)
|
||||
{
|
||||
SourceReferenceFormatter formatter(_stream);
|
||||
SourceReferenceFormatter formatter(_stream, true, false);
|
||||
|
||||
for (auto const& error: _errors)
|
||||
formatter.printErrorInformation(*error);
|
||||
|
@ -96,7 +96,7 @@ TestCase::TestResult ObjectCompilerTest::run(ostream& _stream, string const& _li
|
||||
|
||||
void ObjectCompilerTest::printErrors(ostream& _stream, ErrorList const& _errors)
|
||||
{
|
||||
SourceReferenceFormatter formatter(_stream);
|
||||
SourceReferenceFormatter formatter(_stream, true, false);
|
||||
|
||||
for (auto const& error: _errors)
|
||||
formatter.printErrorInformation(*error);
|
||||
|
@ -104,7 +104,7 @@ string YulInterpreterTest::interpret()
|
||||
|
||||
void YulInterpreterTest::printErrors(ostream& _stream, ErrorList const& _errors)
|
||||
{
|
||||
SourceReferenceFormatter formatter(_stream);
|
||||
SourceReferenceFormatter formatter(_stream, true, false);
|
||||
|
||||
for (auto const& error: _errors)
|
||||
formatter.printErrorInformation(*error);
|
||||
|
@ -496,7 +496,7 @@ void YulOptimizerTest::updateContext()
|
||||
|
||||
void YulOptimizerTest::printErrors(ostream& _stream, ErrorList const& _errors)
|
||||
{
|
||||
SourceReferenceFormatter formatter(_stream);
|
||||
SourceReferenceFormatter formatter(_stream, true, false);
|
||||
|
||||
for (auto const& error: _errors)
|
||||
formatter.printErrorInformation(*error);
|
||||
|
@ -1,5 +1,8 @@
|
||||
#include <test/tools/ossfuzz/abiV2FuzzerCommon.h>
|
||||
|
||||
#include <liblangutil/Exceptions.h>
|
||||
#include <liblangutil/SourceReferenceFormatter.h>
|
||||
|
||||
using namespace solidity::test::abiv2fuzzer;
|
||||
|
||||
SolidityCompilationFramework::SolidityCompilationFramework(langutil::EVMVersion _evmVersion)
|
||||
@ -21,7 +24,7 @@ solidity::bytes SolidityCompilationFramework::compileContract(
|
||||
m_compiler.setOptimiserSettings(_optimization);
|
||||
if (!m_compiler.compile())
|
||||
{
|
||||
langutil::SourceReferenceFormatter formatter(std::cerr);
|
||||
langutil::SourceReferenceFormatter formatter(std::cerr, false, false);
|
||||
|
||||
for (auto const& error: m_compiler.errors())
|
||||
formatter.printExceptionInformation(
|
||||
|
@ -4,9 +4,6 @@
|
||||
|
||||
#include <libyul/AssemblyStack.h>
|
||||
|
||||
#include <liblangutil/Exceptions.h>
|
||||
#include <liblangutil/SourceReferenceFormatter.h>
|
||||
|
||||
#include <libsolutil/Keccak256.h>
|
||||
|
||||
namespace solidity::test::abiv2fuzzer
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include <liblangutil/Exceptions.h>
|
||||
#include <liblangutil/ErrorReporter.h>
|
||||
#include <liblangutil/EVMVersion.h>
|
||||
#include <liblangutil/SourceReferenceFormatter.h>
|
||||
|
||||
#include <libsolutil/CommonIO.h>
|
||||
#include <libsolutil/CommonData.h>
|
||||
|
@ -44,7 +44,7 @@ namespace
|
||||
{
|
||||
void printErrors(ostream& _stream, ErrorList const& _errors)
|
||||
{
|
||||
SourceReferenceFormatter formatter(_stream);
|
||||
SourceReferenceFormatter formatter(_stream, false, false);
|
||||
|
||||
for (auto const& error: _errors)
|
||||
formatter.printExceptionInformation(
|
||||
|
@ -64,7 +64,7 @@ class YulOpti
|
||||
public:
|
||||
void printErrors()
|
||||
{
|
||||
SourceReferenceFormatter formatter(cerr);
|
||||
SourceReferenceFormatter formatter(cerr, true, false);
|
||||
|
||||
for (auto const& error: m_errors)
|
||||
formatter.printErrorInformation(*error);
|
||||
|
@ -58,7 +58,7 @@ namespace
|
||||
void printErrors(ErrorList const& _errors)
|
||||
{
|
||||
for (auto const& error: _errors)
|
||||
SourceReferenceFormatter(cout).printErrorInformation(*error);
|
||||
SourceReferenceFormatter(cout, true, false).printErrorInformation(*error);
|
||||
}
|
||||
|
||||
pair<shared_ptr<Block>, shared_ptr<AsmAnalysisInfo>> parse(string const& _source)
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include <tools/solidityUpgrade/SourceUpgrade.h>
|
||||
|
||||
#include <liblangutil/Exceptions.h>
|
||||
#include <liblangutil/SourceReferenceFormatterHuman.h>
|
||||
#include <liblangutil/SourceReferenceFormatter.h>
|
||||
|
||||
#include <libsolidity/ast/AST.h>
|
||||
|
||||
@ -397,7 +397,7 @@ void SourceUpgrade::applyChange(
|
||||
|
||||
void SourceUpgrade::printErrors() const
|
||||
{
|
||||
auto formatter = make_unique<langutil::SourceReferenceFormatterHuman>(cout, true, false);
|
||||
auto formatter = make_unique<langutil::SourceReferenceFormatter>(cout, true, false);
|
||||
|
||||
for (auto const& error: m_compiler->errors())
|
||||
if (error->type() != langutil::Error::Type::Warning)
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include <tools/solidityUpgrade/UpgradeChange.h>
|
||||
|
||||
#include <liblangutil/SourceReferenceExtractor.h>
|
||||
#include <liblangutil/SourceReferenceFormatterHuman.h>
|
||||
#include <liblangutil/SourceReferenceFormatter.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace solidity;
|
||||
@ -37,7 +37,7 @@ void UpgradeChange::apply()
|
||||
void UpgradeChange::log(bool const _shorten) const
|
||||
{
|
||||
stringstream os;
|
||||
SourceReferenceFormatterHuman formatter{os, true, false};
|
||||
SourceReferenceFormatter formatter{os, true, false};
|
||||
|
||||
string start = to_string(m_location.start);
|
||||
string end = to_string(m_location.end);
|
||||
|
@ -59,7 +59,7 @@ ostream& operator<<(ostream& _stream, Program const& _program);
|
||||
|
||||
ostream& std::operator<<(ostream& _outputStream, ErrorList const& _errors)
|
||||
{
|
||||
SourceReferenceFormatter formatter(_outputStream);
|
||||
SourceReferenceFormatter formatter(_outputStream, true, false);
|
||||
|
||||
for (auto const& error: _errors)
|
||||
formatter.printErrorInformation(*error);
|
||||
|
Loading…
Reference in New Issue
Block a user