aboutsummaryrefslogtreecommitdiffstats
path: root/AST.h
diff options
context:
space:
mode:
Diffstat (limited to 'AST.h')
-rwxr-xr-xAST.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/AST.h b/AST.h
index 525907bf..ecf91c05 100755
--- a/AST.h
+++ b/AST.h
@@ -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;
};
/// @}