From a8c047f48d61a3f27ea37f3b677cc4b1f3cbff3c Mon Sep 17 00:00:00 2001 From: Federico Bond Date: Tue, 8 Aug 2017 18:58:06 -0300 Subject: Enforce commas in tuple syntax --- test/libsolidity/SolidityParser.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/libsolidity/SolidityParser.cpp b/test/libsolidity/SolidityParser.cpp index 2be824d6..3890ca21 100644 --- a/test/libsolidity/SolidityParser.cpp +++ b/test/libsolidity/SolidityParser.cpp @@ -1187,6 +1187,18 @@ BOOST_AUTO_TEST_CASE(tuples) BOOST_CHECK(successParse(text)); } +BOOST_AUTO_TEST_CASE(tuples_without_commas) +{ + char const* text = R"( + contract C { + function f() { + var a = (2 2); + } + } + )"; + CHECK_PARSE_ERROR(text, "Expected token Comma"); +} + BOOST_AUTO_TEST_CASE(member_access_parser_ambiguity) { char const* text = R"( -- cgit