aboutsummaryrefslogtreecommitdiffstats
path: root/liblangutil/Scanner.h
diff options
context:
space:
mode:
authorChristian Parpart <christian@ethereum.org>2018-11-29 08:58:15 +0800
committerChristian Parpart <christian@ethereum.org>2018-12-01 00:07:17 +0800
commit435f7b3b72157e884344adbc7b62033bd08bb51c (patch)
treede4831bb56b16945894b9efc0bea95576b43cea9 /liblangutil/Scanner.h
parentc48a5264be4221873fe02cac57f6a41a32010fea (diff)
downloaddexon-solidity-435f7b3b72157e884344adbc7b62033bd08bb51c.tar.gz
dexon-solidity-435f7b3b72157e884344adbc7b62033bd08bb51c.tar.zst
dexon-solidity-435f7b3b72157e884344adbc7b62033bd08bb51c.zip
liblangutil: Scanner: remove superfluous sourceName field (it's in CharStream already)
Also, ParserBase::sourceName() was dead code. Eliminating it should increase test coverage (how sneaky) :-)
Diffstat (limited to 'liblangutil/Scanner.h')
-rw-r--r--liblangutil/Scanner.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/liblangutil/Scanner.h b/liblangutil/Scanner.h
index dc37745f..a1185369 100644
--- a/liblangutil/Scanner.h
+++ b/liblangutil/Scanner.h
@@ -91,14 +91,14 @@ class Scanner
friend class LiteralScope;
public:
explicit Scanner(std::shared_ptr<CharStream> _source) { reset(std::move(_source)); }
- explicit Scanner(CharStream _source = CharStream(), std::string _sourceName = "") { reset(std::move(_source), std::move(_sourceName)); }
+ explicit Scanner(CharStream _source = CharStream()) { reset(std::move(_source)); }
std::string source() const { return m_source->source(); }
std::shared_ptr<CharStream> charStream() noexcept { return m_source; }
- /// Resets the scanner as if newly constructed with _source and _sourceName as input.
- void reset(CharStream _source, std::string _sourceName);
+ /// Resets the scanner as if newly constructed with _source as input.
+ void reset(CharStream _source);
void reset(std::shared_ptr<CharStream> _source);
/// Resets scanner to the start of input.
void reset();
@@ -150,8 +150,6 @@ public:
std::string const& peekLiteral() const { return m_nextToken.literal; }
///@}
- std::shared_ptr<std::string const> const& sourceName() const { return m_sourceName; }
-
///@{
///@name Error printing helper functions
/// Functions that help pretty-printing parse errors
@@ -242,7 +240,6 @@ private:
TokenDesc m_nextToken; // desc for next token (one token look-ahead)
std::shared_ptr<CharStream> m_source;
- std::shared_ptr<std::string const> m_sourceName;
/// one character look-ahead, equals 0 at end of input
char m_char;