diff options
author | chriseth <chris@ethereum.org> | 2018-12-01 06:45:31 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-01 06:45:31 +0800 |
commit | aaeb74f59283486ee95d71f896cf2dd6cbe503f7 (patch) | |
tree | 062fbcc8d84ce2bfa5bb0bb2ef200ba402bb3e8b /liblangutil/CharStream.h | |
parent | cc00d8172b6cd7f9fc032e4a21857455ace2f290 (diff) | |
parent | 757623e381aba24b81a2365cf19037d3d96bf945 (diff) | |
download | dexon-solidity-aaeb74f59283486ee95d71f896cf2dd6cbe503f7.tar.gz dexon-solidity-aaeb74f59283486ee95d71f896cf2dd6cbe503f7.tar.zst dexon-solidity-aaeb74f59283486ee95d71f896cf2dd6cbe503f7.zip |
Merge pull request #5537 from ethereum/cp-SourceLocation-related-refactoring
[1/3] SourceLocation related refactoring.
Diffstat (limited to 'liblangutil/CharStream.h')
-rw-r--r-- | liblangutil/CharStream.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/liblangutil/CharStream.h b/liblangutil/CharStream.h index 72aacacf..f92beb30 100644 --- a/liblangutil/CharStream.h +++ b/liblangutil/CharStream.h @@ -68,7 +68,8 @@ class CharStream { public: CharStream(): m_position(0) {} - explicit CharStream(std::string const& _source): m_source(_source), m_position(0) {} + explicit CharStream(std::string const& _source, std::string const& name): + m_source(_source), m_name(name), m_position(0) {} int position() const { return m_position; } bool isPastEndOfInput(size_t _charsForward = 0) const { return (m_position + _charsForward) >= m_source.size(); } @@ -79,7 +80,8 @@ public: void reset() { m_position = 0; } - std::string const& source() const { return m_source; } + std::string const& source() const noexcept { return m_source; } + std::string const& name() const noexcept { return m_name; } ///@{ ///@name Error printing helper functions @@ -91,6 +93,7 @@ public: private: std::string m_source; + std::string m_name; size_t m_position; }; |