aboutsummaryrefslogtreecommitdiffstats
path: root/liblangutil/Scanner.h
diff options
context:
space:
mode:
authorChristian Parpart <christian@ethereum.org>2018-11-15 00:11:55 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-11-22 03:13:44 +0800
commitd67322a1861d60a88151f7c25d6c3478a9a39acf (patch)
treeaf485e48c3436cd24e2db09a6a1bcf445605bae1 /liblangutil/Scanner.h
parent80371e2d25ce3eb868d6f75b99a54af9dc6c1583 (diff)
downloaddexon-solidity-d67322a1861d60a88151f7c25d6c3478a9a39acf.tar.gz
dexon-solidity-d67322a1861d60a88151f7c25d6c3478a9a39acf.tar.zst
dexon-solidity-d67322a1861d60a88151f7c25d6c3478a9a39acf.zip
Introduce namespace `langutil` in liblangutil directory.
Also: - Use {}-style list initialisation for SourceLocation construction - Introduce new system includes - Changes the API of the Scanner to take source as value (with move) as opposed to as a reference
Diffstat (limited to 'liblangutil/Scanner.h')
-rw-r--r--liblangutil/Scanner.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/liblangutil/Scanner.h b/liblangutil/Scanner.h
index 5e5ddfdd..da5e3dfb 100644
--- a/liblangutil/Scanner.h
+++ b/liblangutil/Scanner.h
@@ -52,15 +52,13 @@
#pragma once
-#include <libdevcore/Common.h>
-#include <libdevcore/CommonData.h>
+#include <liblangutil/Token.h>
#include <liblangutil/CharStream.h>
#include <liblangutil/SourceLocation.h>
-#include <liblangutil/Token.h>
+#include <libdevcore/Common.h>
+#include <libdevcore/CommonData.h>
-namespace dev
-{
-namespace solidity
+namespace langutil
{
class AstRawString;
@@ -71,13 +69,12 @@ class Scanner
{
friend class LiteralScope;
public:
-
- explicit Scanner(CharStream const& _source = CharStream(), std::string const& _sourceName = "") { reset(_source, _sourceName); }
+ explicit Scanner(CharStream _source = CharStream(), std::string _sourceName = "") { reset(std::move(_source), std::move(_sourceName)); }
std::string source() const { return m_source.source(); }
/// Resets the scanner as if newly constructed with _source and _sourceName as input.
- void reset(CharStream const& _source, std::string const& _sourceName);
+ void reset(CharStream _source, std::string _sourceName);
/// Resets scanner to the start of input.
void reset();
@@ -216,4 +213,3 @@ private:
};
}
-}