diff options
Diffstat (limited to 'Scanner.cpp')
-rw-r--r-- | Scanner.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/Scanner.cpp b/Scanner.cpp index 2f5f8d37..e155f550 100644 --- a/Scanner.cpp +++ b/Scanner.cpp @@ -143,17 +143,28 @@ private: }; // end of LiteralScope class -void Scanner::reset(CharStream const& _source) +void Scanner::reset(CharStream const& _source, std::string const& _sourceName) { m_source = _source; + + shared_ptr<string> sourceName = make_shared<string>(_sourceName); + m_currentToken.location.sourceName = sourceName; + m_nextToken.location.sourceName = sourceName; + m_skippedComment.location.sourceName = sourceName; + m_nextSkippedComment.location.sourceName = sourceName; + + reset(); +} + +void Scanner::reset() +{ + m_source.reset(); m_char = m_source.get(); skipWhitespace(); scanToken(); - next(); } - bool Scanner::scanHexByte(char& o_scannedByte) { char x = 0; |