aboutsummaryrefslogtreecommitdiffstats
path: root/SolidityScanner.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-05 00:35:23 +0800
commitec3384a23f3711f2a7c95c7ac8d793cbae7228f6 (patch)
tree47f3f5dbdf67a3930fc3b6bea858af6e2c37aafd /SolidityScanner.cpp
parent4d0695c3af26ea4a7310d84bc17c2dfc21186da4 (diff)
downloaddexon-solidity-ec3384a23f3711f2a7c95c7ac8d793cbae7228f6.tar
dexon-solidity-ec3384a23f3711f2a7c95c7ac8d793cbae7228f6.tar.gz
dexon-solidity-ec3384a23f3711f2a7c95c7ac8d793cbae7228f6.tar.bz2
dexon-solidity-ec3384a23f3711f2a7c95c7ac8d793cbae7228f6.tar.lz
dexon-solidity-ec3384a23f3711f2a7c95c7ac8d793cbae7228f6.tar.xz
dexon-solidity-ec3384a23f3711f2a7c95c7ac8d793cbae7228f6.tar.zst
dexon-solidity-ec3384a23f3711f2a7c95c7ac8d793cbae7228f6.zip
Add date/time language to solidity.
Diffstat (limited to 'SolidityScanner.cpp')
-rw-r--r--SolidityScanner.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/SolidityScanner.cpp b/SolidityScanner.cpp
index 2e4e5db0..8d3e5392 100644
--- a/SolidityScanner.cpp
+++ b/SolidityScanner.cpp
@@ -264,6 +264,23 @@ BOOST_AUTO_TEST_CASE(ether_subdenominations)
BOOST_CHECK_EQUAL(scanner.next(), Token::SubEther);
}
+BOOST_AUTO_TEST_CASE(time_subdenominations)
+{
+ Scanner scanner(CharStream("seconds minutes hours days weeks years"));
+ BOOST_CHECK_EQUAL(scanner.getCurrentToken(), Token::SubSecond);
+ BOOST_CHECK_EQUAL(scanner.next(), Token::SubMinute);
+ BOOST_CHECK_EQUAL(scanner.next(), Token::SubHour);
+ BOOST_CHECK_EQUAL(scanner.next(), Token::SubDay);
+ BOOST_CHECK_EQUAL(scanner.next(), Token::SubWeek);
+ BOOST_CHECK_EQUAL(scanner.next(), Token::SubYear);
+}
+
+BOOST_AUTO_TEST_CASE(time_after)
+{
+ Scanner scanner(CharStream("after 1"));
+ BOOST_CHECK_EQUAL(scanner.getCurrentToken(), Token::After);
+}
+
BOOST_AUTO_TEST_SUITE_END()
}