mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Added a flag to record when a source is reconstructed from JSON so garbage code snippets are not printed after source location.
This commit is contained in:
@@ -73,9 +73,15 @@ public:
|
||||
CharStream() = default;
|
||||
CharStream(std::string _source, std::string _name):
|
||||
m_source(std::move(_source)), m_name(std::move(_name)) {}
|
||||
CharStream(std::string _source, std::string _name, bool _importedFromAST):
|
||||
m_source(std::move(_source)),
|
||||
m_name(std::move(_name)),
|
||||
m_importedFromAST(_importedFromAST)
|
||||
{ }
|
||||
|
||||
size_t position() const { return m_position; }
|
||||
bool isPastEndOfInput(size_t _charsForward = 0) const { return (m_position + _charsForward) >= m_source.size(); }
|
||||
bool isImportedFromAST() const { return m_importedFromAST; }
|
||||
|
||||
char get(size_t _charsForward = 0) const { return m_source[m_position + _charsForward]; }
|
||||
char advanceAndGet(size_t _chars = 1);
|
||||
@@ -138,6 +144,7 @@ public:
|
||||
private:
|
||||
std::string m_source;
|
||||
std::string m_name;
|
||||
bool m_importedFromAST{false};
|
||||
size_t m_position{0};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user