mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Version pragma.
This commit is contained in:
@@ -175,6 +175,34 @@ private:
|
||||
ASTNode const* m_scope;
|
||||
};
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
||||
Reference in New Issue
Block a user