aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/inlineasm/AsmParser.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 /libsolidity/inlineasm/AsmParser.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 'libsolidity/inlineasm/AsmParser.h')
-rw-r--r--libsolidity/inlineasm/AsmParser.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/libsolidity/inlineasm/AsmParser.h b/libsolidity/inlineasm/AsmParser.h
index b3d74df1..9e13799a 100644
--- a/libsolidity/inlineasm/AsmParser.h
+++ b/libsolidity/inlineasm/AsmParser.h
@@ -25,6 +25,8 @@
#include <memory>
#include <vector>
#include <libsolidity/inlineasm/AsmData.h>
+#include <liblangutil/SourceLocation.h>
+#include <liblangutil/Scanner.h>
#include <liblangutil/ParserBase.h>
namespace dev
@@ -34,22 +36,22 @@ namespace solidity
namespace assembly
{
-class Parser: public ParserBase
+class Parser: public langutil::ParserBase
{
public:
- explicit Parser(ErrorReporter& _errorReporter, AsmFlavour _flavour = AsmFlavour::Loose):
+ explicit Parser(langutil::ErrorReporter& _errorReporter, AsmFlavour _flavour = AsmFlavour::Loose):
ParserBase(_errorReporter), m_flavour(_flavour) {}
/// Parses an inline assembly block starting with `{` and ending with `}`.
/// @param _reuseScanner if true, do check for end of input after the `}`.
/// @returns an empty shared pointer on error.
- std::shared_ptr<Block> parse(std::shared_ptr<Scanner> const& _scanner, bool _reuseScanner);
+ std::shared_ptr<Block> parse(std::shared_ptr<langutil::Scanner> const& _scanner, bool _reuseScanner);
protected:
using ElementaryOperation = boost::variant<assembly::Instruction, assembly::Literal, assembly::Identifier>;
/// Creates an inline assembly node with the given source location.
- template <class T> T createWithLocation(SourceLocation const& _loc = SourceLocation()) const
+ template <class T> T createWithLocation(langutil::SourceLocation const& _loc = {}) const
{
T r;
r.location = _loc;
@@ -62,7 +64,7 @@ protected:
r.location.sourceName = sourceName();
return r;
}
- SourceLocation location() const { return SourceLocation(position(), endPosition(), sourceName()); }
+ langutil::SourceLocation location() const { return {position(), endPosition(), sourceName()}; }
Block parseBlock();
Statement parseStatement();