aboutsummaryrefslogtreecommitdiffstats
path: root/Types.cpp
diff options
context:
space:
mode:
authorGav Wood <i@gavwood.com>2015-03-05 00:35:23 +0800
committerGav Wood <i@gavwood.com>2015-03-06 19:46:23 +0800
commit9aea119e54fbf2afa6d999e5419bb9db93eed2ce (patch)
tree6f4337f34e6a7e7fe0cf8572ac4d8e6c8ff5274f /Types.cpp
parent34e8de749aeecbca5f5dae817aa67f42907e9bf7 (diff)
downloaddexon-solidity-9aea119e54fbf2afa6d999e5419bb9db93eed2ce.tar.gz
dexon-solidity-9aea119e54fbf2afa6d999e5419bb9db93eed2ce.tar.zst
dexon-solidity-9aea119e54fbf2afa6d999e5419bb9db93eed2ce.zip
Add date/time language to solidity.
Diffstat (limited to 'Types.cpp')
-rw-r--r--Types.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/Types.cpp b/Types.cpp
index 96feefff..caa3b716 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -195,7 +195,8 @@ TypePointer IntegerType::unaryOperatorResult(Token::Value _operator) const
return TypePointer();
// for non-hash integers, we allow +, -, ++ and --
else if (_operator == Token::Add || _operator == Token::Sub ||
- _operator == Token::Inc || _operator == Token::Dec)
+ _operator == Token::Inc || _operator == Token::Dec ||
+ _operator == Token::After)
return shared_from_this();
else
return TypePointer();
@@ -251,6 +252,7 @@ IntegerConstantType::IntegerConstantType(Literal const& _literal)
switch (_literal.getSubDenomination())
{
case Literal::SubDenomination::Wei:
+ case Literal::SubDenomination::Second:
case Literal::SubDenomination::None:
break;
case Literal::SubDenomination::Szabo:
@@ -262,6 +264,21 @@ IntegerConstantType::IntegerConstantType(Literal const& _literal)
case Literal::SubDenomination::Ether:
m_value *= bigint("1000000000000000000");
break;
+ case Literal::SubDenomination::Minute:
+ m_value *= bigint("60");
+ break;
+ case Literal::SubDenomination::Hour:
+ m_value *= bigint("3600");
+ break;
+ case Literal::SubDenomination::Day:
+ m_value *= bigint("86400");
+ break;
+ case Literal::SubDenomination::Week:
+ m_value *= bigint("604800");
+ break;
+ case Literal::SubDenomination::Year:
+ m_value *= bigint("31536000");
+ break;
}
}