mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Eliminate some unnecessary header inclusions in headers in SourceLocation.h
This commit is contained in:
parent
81e9225304
commit
ac0c749a32
@ -21,6 +21,8 @@
|
||||
#include <boost/algorithm/string/split.hpp>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
using namespace solidity;
|
||||
using namespace solidity::langutil;
|
||||
using namespace std;
|
||||
@ -50,3 +52,16 @@ SourceLocation solidity::langutil::parseSourceLocation(string const& _input, vec
|
||||
result.sourceName = _sourceNames.at(static_cast<size_t>(sourceIndex));
|
||||
return result;
|
||||
}
|
||||
|
||||
std::ostream& solidity::langutil::operator<<(std::ostream& _out, SourceLocation const& _location)
|
||||
{
|
||||
if (!_location.isValid())
|
||||
return _out << "NO_LOCATION_SPECIFIED";
|
||||
|
||||
if (_location.sourceName)
|
||||
_out << *_location.sourceName;
|
||||
|
||||
_out << "[" << _location.start << "," << _location.end << "]";
|
||||
|
||||
return _out;
|
||||
}
|
||||
|
@ -23,16 +23,14 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <libsolutil/Assertions.h>
|
||||
#include <libsolutil/Exceptions.h>
|
||||
|
||||
#include <limits>
|
||||
#include <iosfwd>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <vector>
|
||||
|
||||
namespace solidity::langutil
|
||||
{
|
||||
struct SourceLocationError: virtual util::Exception {};
|
||||
|
||||
/**
|
||||
* Representation of an interval of source positions.
|
||||
@ -112,17 +110,6 @@ SourceLocation parseSourceLocation(
|
||||
);
|
||||
|
||||
/// Stream output for Location (used e.g. in boost exceptions).
|
||||
inline std::ostream& operator<<(std::ostream& _out, SourceLocation const& _location)
|
||||
{
|
||||
if (!_location.isValid())
|
||||
return _out << "NO_LOCATION_SPECIFIED";
|
||||
|
||||
if (_location.sourceName)
|
||||
_out << *_location.sourceName;
|
||||
|
||||
_out << "[" << _location.start << "," << _location.end << "]";
|
||||
|
||||
return _out;
|
||||
}
|
||||
std::ostream& operator<<(std::ostream& _out, SourceLocation const& _location);
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user