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-06 19:46:23 +0800
commita20b4b548d7bd8942e574cd451e6bc96db993411 (patch)
tree06a3545d81a5223a92b12c4704b9572a795c159f /SolidityScanner.cpp
parentdfcbfd24fa2f9a03fa129ab2592752080612910a (diff)
downloaddexon-solidity-a20b4b548d7bd8942e574cd451e6bc96db993411.tar
dexon-solidity-a20b4b548d7bd8942e574cd451e6bc96db993411.tar.gz
dexon-solidity-a20b4b548d7bd8942e574cd451e6bc96db993411.tar.bz2
dexon-solidity-a20b4b548d7bd8942e574cd451e6bc96db993411.tar.lz
dexon-solidity-a20b4b548d7bd8942e574cd451e6bc96db993411.tar.xz
dexon-solidity-a20b4b548d7bd8942e574cd451e6bc96db993411.tar.zst
dexon-solidity-a20b4b548d7bd8942e574cd451e6bc96db993411.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()
}