diff options
author | Christian <c@ethdev.com> | 2014-12-04 00:45:12 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2014-12-04 01:51:59 +0800 |
commit | 254df50feab6bb4c9f013257591b73919e4013a5 (patch) | |
tree | f8258a07f87046e1695373bc6024af87f51f51be /Scanner.cpp | |
parent | 328387d6d0a14143f1634df11036a91fad85cec9 (diff) | |
download | dexon-solidity-254df50feab6bb4c9f013257591b73919e4013a5.tar.gz dexon-solidity-254df50feab6bb4c9f013257591b73919e4013a5.tar.zst dexon-solidity-254df50feab6bb4c9f013257591b73919e4013a5.zip |
Multi-source and multi-contract compiler.
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; |