diff options
author | chriseth <c@ethdev.com> | 2016-04-18 19:47:40 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-04-20 00:35:21 +0800 |
commit | ed9da5171b84e6e1846820a45d97e5c041d57206 (patch) | |
tree | fd74dd485ded436d3b170be627087857396ea65d /libsolidity/inlineasm/AsmParser.h | |
parent | 81ae2a78321fddcd2d32efc51568ebeca28866a8 (diff) | |
download | dexon-solidity-ed9da5171b84e6e1846820a45d97e5c041d57206.tar.gz dexon-solidity-ed9da5171b84e6e1846820a45d97e5c041d57206.tar.zst dexon-solidity-ed9da5171b84e6e1846820a45d97e5c041d57206.zip |
Source location for inline assembly.
Diffstat (limited to 'libsolidity/inlineasm/AsmParser.h')
-rw-r--r-- | libsolidity/inlineasm/AsmParser.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/libsolidity/inlineasm/AsmParser.h b/libsolidity/inlineasm/AsmParser.h index b54da941..0a9d51d5 100644 --- a/libsolidity/inlineasm/AsmParser.h +++ b/libsolidity/inlineasm/AsmParser.h @@ -44,13 +44,29 @@ public: std::shared_ptr<Block> parse(std::shared_ptr<Scanner> const& _scanner); protected: + /// Creates an inline assembly node with the given source location. + template <class T> T createWithLocation(SourceLocation const& _loc = SourceLocation()) + { + T r; + r.location = _loc; + if (r.location.isEmpty()) + { + r.location.start = position(); + r.location.end = endPosition(); + } + if (!r.location.sourceName) + r.location.sourceName = sourceName(); + return r; + } + SourceLocation location() const { return SourceLocation(position(), endPosition(), sourceName()); } + Block parseBlock(); Statement parseStatement(); /// Parses a functional expression that has to push exactly one stack element Statement parseExpression(); Statement parseElementaryOperation(bool _onlySinglePusher = false); VariableDeclaration parseVariableDeclaration(); - FunctionalInstruction parseFunctionalInstruction(Statement const& _instruction); + FunctionalInstruction parseFunctionalInstruction(Statement&& _instruction); }; } |