diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2015-02-04 23:37:54 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2015-02-05 00:52:28 +0800 |
commit | dca5f7b57bb5b535930d437c806f48a25cf6b569 (patch) | |
tree | 04ee06c48c7ca6c4f012c6778bb9ea01248582d9 /AST.h | |
parent | db263bd9d751f69f9d8d9484ff916d38b86c68c4 (diff) | |
download | dexon-solidity-dca5f7b57bb5b535930d437c806f48a25cf6b569.tar dexon-solidity-dca5f7b57bb5b535930d437c806f48a25cf6b569.tar.gz dexon-solidity-dca5f7b57bb5b535930d437c806f48a25cf6b569.tar.bz2 dexon-solidity-dca5f7b57bb5b535930d437c806f48a25cf6b569.tar.lz dexon-solidity-dca5f7b57bb5b535930d437c806f48a25cf6b569.tar.xz dexon-solidity-dca5f7b57bb5b535930d437c806f48a25cf6b569.tar.zst dexon-solidity-dca5f7b57bb5b535930d437c806f48a25cf6b569.zip |
Adding ether subdenominations after constan literals
Diffstat (limited to 'AST.h')
-rwxr-xr-x | AST.h | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -1112,13 +1112,20 @@ private: }; /** - * A literal string or number. @see Type::literalToBigEndian is used to actually parse its value. + * A literal string or number. @see ExpressionCompiler::endVisit() is used to actually parse its value. */ class Literal: public PrimaryExpression { public: - Literal(Location const& _location, Token::Value _token, ASTPointer<ASTString> const& _value): - PrimaryExpression(_location), m_token(_token), m_value(_value) {} + enum class ethSubDenomination { + NONE = Token::ILLEGAL, + WEI = Token::ETH_SUB_WEI, + SZABO = Token::ETH_SUB_SZABO, + FINNEY = Token::ETH_SUB_FINNEY, + ETHER = Token::ETH_SUB_ETHER}; + Literal(Location const& _location, Token::Value _token, + ASTPointer<ASTString> const& _value, + Token::Value _sub = Token::ILLEGAL); virtual void accept(ASTVisitor& _visitor) override; virtual void accept(ASTConstVisitor& _visitor) const override; virtual void checkTypeRequirements() override; @@ -1127,9 +1134,12 @@ public: /// @returns the non-parsed value of the literal ASTString const& getValue() const { return *m_value; } + ethSubDenomination getSubDenomination() const { return m_subDenomination; } + private: Token::Value m_token; ASTPointer<ASTString> m_value; + ethSubDenomination m_subDenomination; }; /// @} |