diff options
author | chriseth <chris@ethereum.org> | 2016-09-01 17:02:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-01 17:02:50 +0800 |
commit | b5d941d3d9f32193c7f9094dee20511585508f6a (patch) | |
tree | 05b5156cbc8fb901102890994842412f18504d06 /libsolidity/ast/AST.h | |
parent | 4a26adfb7d4e962de094f4c6f02139181fac1699 (diff) | |
parent | 4abba77ddc0b4402597d13d5c29adcf5cac82e11 (diff) | |
download | dexon-solidity-b5d941d3d9f32193c7f9094dee20511585508f6a.tar.gz dexon-solidity-b5d941d3d9f32193c7f9094dee20511585508f6a.tar.zst dexon-solidity-b5d941d3d9f32193c7f9094dee20511585508f6a.zip |
Merge pull request #935 from chriseth/pragma
Version pragma
Diffstat (limited to 'libsolidity/ast/AST.h')
-rw-r--r-- | libsolidity/ast/AST.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h index bf275869..761d85fe 100644 --- a/libsolidity/ast/AST.h +++ b/libsolidity/ast/AST.h @@ -176,6 +176,34 @@ private: }; /** + * Pragma directive, only version requirements in the form `pragma solidity "^0.4.0";` are + * supported for now. + */ +class PragmaDirective: public ASTNode +{ +public: + PragmaDirective( + SourceLocation const& _location, + std::vector<Token::Value> const& _tokens, + std::vector<ASTString> const& _literals + ): ASTNode(_location), m_tokens(_tokens), m_literals(_literals) + {} + + virtual void accept(ASTVisitor& _visitor) override; + virtual void accept(ASTConstVisitor& _visitor) const override; + + std::vector<Token::Value> const& tokens() const { return m_tokens; } + std::vector<ASTString> const& literals() const { return m_literals; } + +private: + + /// Sequence of tokens following the "pragma" keyword. + std::vector<Token::Value> m_tokens; + /// Sequence of literals following the "pragma" keyword. + std::vector<ASTString> m_literals; +}; + +/** * Import directive for referencing other files / source objects. * Example: import "abc.sol" // imports all symbols of "abc.sol" into current scope * Source objects are identified by a string which can be a file name but does not have to be. |