From e4b7b2160e0f98670d39c9651e7ceafd6b1aea32 Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Thu, 1 Mar 2018 12:18:44 +0100 Subject: Add new reserved keywords. --- test/libsolidity/SolidityParser.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/libsolidity/SolidityParser.cpp b/test/libsolidity/SolidityParser.cpp index 0797b53b..1ffbd771 100644 --- a/test/libsolidity/SolidityParser.cpp +++ b/test/libsolidity/SolidityParser.cpp @@ -491,28 +491,46 @@ BOOST_AUTO_TEST_CASE(keyword_is_reserved) auto keywords = { "abstract", "after", + "alias", + "apply", + "auto", "case", "catch", + "copyof", "default", + "define", "final", + "immutable", + "implements", "in", "inline", "let", + "macro", "match", + "mutable", "null", "of", + "override", + "partial", + "promise", + "reference", "relocatable", + "sealed", + "sizeof", "static", + "supports", "switch", "try", "type", - "typeof" + "typedef", + "typeof", + "unchecked" }; for (const auto& keyword: keywords) { auto text = std::string("contract ") + keyword + " {}"; - CHECK_PARSE_ERROR(text.c_str(), "Expected identifier but got reserved keyword"); + CHECK_PARSE_ERROR(text.c_str(), string("Expected identifier but got reserved keyword '") + keyword + "'"); } } -- cgit v1.2.3