From 9836d58df8372fe13590c61ad8ebce7cfbe32015 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 13 Feb 2015 23:47:55 +0100 Subject: [PATCH] Removing ';' from the end of EnumDefinition --- SolidityEndToEndTest.cpp | 2 +- SolidityNameAndTypeResolution.cpp | 12 ++++++------ SolidityParser.cpp | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/SolidityEndToEndTest.cpp b/SolidityEndToEndTest.cpp index 551607df2..2ef2b8038 100644 --- a/SolidityEndToEndTest.cpp +++ b/SolidityEndToEndTest.cpp @@ -2503,7 +2503,7 @@ BOOST_AUTO_TEST_CASE(using_enums) { char const* sourceCode = R"( contract test { - enum ActionChoices { GoLeft, GoRight, GoStraight, Sit }; + enum ActionChoices { GoLeft, GoRight, GoStraight, Sit } function test() { choices = ActionChoices.GoStraight; diff --git a/SolidityNameAndTypeResolution.cpp b/SolidityNameAndTypeResolution.cpp index f3edfc313..ec49a42d1 100644 --- a/SolidityNameAndTypeResolution.cpp +++ b/SolidityNameAndTypeResolution.cpp @@ -996,7 +996,7 @@ BOOST_AUTO_TEST_CASE(enum_member_access) { char const* text = R"( contract test { - enum ActionChoices { GoLeft, GoRight, GoStraight, Sit }; + enum ActionChoices { GoLeft, GoRight, GoStraight, Sit } function test() { choices = ActionChoices.GoStraight; @@ -1011,7 +1011,7 @@ BOOST_AUTO_TEST_CASE(enum_invalid_member_access) { char const* text = R"( contract test { - enum ActionChoices { GoLeft, GoRight, GoStraight, Sit }; + enum ActionChoices { GoLeft, GoRight, GoStraight, Sit } function test() { choices = ActionChoices.RunAroundWavingYourHands; @@ -1026,7 +1026,7 @@ BOOST_AUTO_TEST_CASE(enum_explicit_conversion_is_okay) { char const* text = R"( contract test { - enum ActionChoices { GoLeft, GoRight, GoStraight, Sit }; + enum ActionChoices { GoLeft, GoRight, GoStraight, Sit } function test() { a = uint256(ActionChoices.GoStraight); @@ -1043,7 +1043,7 @@ BOOST_AUTO_TEST_CASE(int_to_enum_explicit_conversion_is_okay) { char const* text = R"( contract test { - enum ActionChoices { GoLeft, GoRight, GoStraight, Sit }; + enum ActionChoices { GoLeft, GoRight, GoStraight, Sit } function test() { a = 2; @@ -1060,7 +1060,7 @@ BOOST_AUTO_TEST_CASE(enum_implicit_conversion_is_not_okay) { char const* text = R"( contract test { - enum ActionChoices { GoLeft, GoRight, GoStraight, Sit }; + enum ActionChoices { GoLeft, GoRight, GoStraight, Sit } function test() { a = ActionChoices.GoStraight; @@ -1077,7 +1077,7 @@ BOOST_AUTO_TEST_CASE(enum_duplicate_values) { char const* text = R"( contract test { - enum ActionChoices { GoLeft, GoRight, GoLeft, Sit }; + enum ActionChoices { GoLeft, GoRight, GoLeft, Sit } } )"; BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError); diff --git a/SolidityParser.cpp b/SolidityParser.cpp index 702d1d6db..af82f612a 100644 --- a/SolidityParser.cpp +++ b/SolidityParser.cpp @@ -707,7 +707,7 @@ BOOST_AUTO_TEST_CASE(enum_valid_declaration) { char const* text = R"( contract c { - enum validEnum { Value1, Value2, Value3, Value4 }; + enum validEnum { Value1, Value2, Value3, Value4 } function c () { a = foo.Value3; @@ -721,7 +721,7 @@ BOOST_AUTO_TEST_CASE(empty_enum_declaration) { char const* text = R"( contract c { - enum foo { }; + enum foo { } })"; BOOST_CHECK_NO_THROW(parseTextExplainError(text)); } @@ -730,7 +730,7 @@ BOOST_AUTO_TEST_CASE(malformed_enum_declaration) { char const* text = R"( contract c { - enum foo { WARNING,}; + enum foo { WARNING,} })"; BOOST_CHECK_THROW(parseText(text), ParserError); }