From 0988eba4fe8dd5f0630cf509663887d8f135fe5e Mon Sep 17 00:00:00 2001 From: Denton Liu Date: Fri, 5 Aug 2016 16:45:54 -0400 Subject: [PATCH 1/8] Remove after from Token.h --- libsolidity/parsing/Token.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libsolidity/parsing/Token.h b/libsolidity/parsing/Token.h index 581df3a59..5ac7aedd8 100644 --- a/libsolidity/parsing/Token.h +++ b/libsolidity/parsing/Token.h @@ -185,7 +185,6 @@ namespace solidity K(SubDay, "days", 0) \ K(SubWeek, "weeks", 0) \ K(SubYear, "years", 0) \ - K(After, "after", 0) \ /* type keywords*/ \ K(Int, "int", 0) \ K(UInt, "uint", 0) \ @@ -215,6 +214,7 @@ namespace solidity T(Identifier, NULL, 0) \ \ /* Keywords reserved for future use. */ \ + K(After, "after", 0) \ K(As, "as", 0) \ K(Case, "case", 0) \ K(Catch, "catch", 0) \ @@ -277,7 +277,7 @@ public: static bool isBitOp(Value op) { return (BitOr <= op && op <= BitAnd) || op == BitNot; } static bool isBooleanOp(Value op) { return (Or <= op && op <= And) || op == Not; } - static bool isUnaryOp(Value op) { return (Not <= op && op <= Delete) || op == Add || op == Sub || op == After; } + static bool isUnaryOp(Value op) { return (Not <= op && op <= Delete) || op == Add || op == Sub; } static bool isCountOp(Value op) { return op == Inc || op == Dec; } static bool isShiftOp(Value op) { return (SHL <= op) && (op <= SHR); } static bool isVisibilitySpecifier(Value op) { return isVariableVisibilitySpecifier(op) || op == External; } From 5ee846e39fb69a07a297a1af828e1b11c237f83a Mon Sep 17 00:00:00 2001 From: Denton Liu Date: Fri, 5 Aug 2016 16:53:47 -0400 Subject: [PATCH 2/8] Remove After from ExpressionCompiler --- libsolidity/codegen/ExpressionCompiler.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp index 80009a90e..1d5745560 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -297,9 +297,6 @@ bool ExpressionCompiler::visit(UnaryOperation const& _unaryOperation) case Token::BitNot: // ~ m_context << Instruction::NOT; break; - case Token::After: // after - m_context << Instruction::TIMESTAMP << Instruction::ADD; - break; case Token::Delete: // delete solAssert(!!m_currentLValue, "LValue not retrieved."); m_currentLValue->setToZero(_unaryOperation.location()); From be98d3db511f278d793fba6829ca73b10ac5af87 Mon Sep 17 00:00:00 2001 From: Denton Liu Date: Mon, 8 Aug 2016 14:17:54 -0400 Subject: [PATCH 3/8] Change After to a deprecated token --- libsolidity/parsing/Token.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libsolidity/parsing/Token.h b/libsolidity/parsing/Token.h index 5ac7aedd8..e3516b979 100644 --- a/libsolidity/parsing/Token.h +++ b/libsolidity/parsing/Token.h @@ -214,7 +214,6 @@ namespace solidity T(Identifier, NULL, 0) \ \ /* Keywords reserved for future use. */ \ - K(After, "after", 0) \ K(As, "as", 0) \ K(Case, "case", 0) \ K(Catch, "catch", 0) \ @@ -230,6 +229,10 @@ namespace solidity K(Type, "type", 0) \ K(TypeOf, "typeof", 0) \ K(Using, "using", 0) \ + \ + /* Deprecated tokens. */ \ + K(After, "after", 0) \ + \ /* Illegal token - not able to scan. */ \ T(Illegal, "ILLEGAL", 0) \ \ @@ -285,6 +288,7 @@ public: static bool isLocationSpecifier(Value op) { return op == Memory || op == Storage; } static bool isEtherSubdenomination(Value op) { return op == SubWei || op == SubSzabo || op == SubFinney || op == SubEther; } static bool isTimeSubdenomination(Value op) { return op == SubSecond || op == SubMinute || op == SubHour || op == SubDay || op == SubWeek || op == SubYear; } + static bool isDeprecated(Value op) { return op == After; } // @returns a string corresponding to the JS token string // (.e., "<" for the token LT) or NULL if the token doesn't From cab8e63a0e55e60a9e1e361140a9a031de6ea254 Mon Sep 17 00:00:00 2001 From: Denton Liu Date: Tue, 9 Aug 2016 10:25:44 -0400 Subject: [PATCH 4/8] Revert "Change After to a deprecated token" This reverts commit 91c97f73b50fc87662b5490b2fe6de1c6ef376c7. --- libsolidity/parsing/Token.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/libsolidity/parsing/Token.h b/libsolidity/parsing/Token.h index e3516b979..5ac7aedd8 100644 --- a/libsolidity/parsing/Token.h +++ b/libsolidity/parsing/Token.h @@ -214,6 +214,7 @@ namespace solidity T(Identifier, NULL, 0) \ \ /* Keywords reserved for future use. */ \ + K(After, "after", 0) \ K(As, "as", 0) \ K(Case, "case", 0) \ K(Catch, "catch", 0) \ @@ -229,10 +230,6 @@ namespace solidity K(Type, "type", 0) \ K(TypeOf, "typeof", 0) \ K(Using, "using", 0) \ - \ - /* Deprecated tokens. */ \ - K(After, "after", 0) \ - \ /* Illegal token - not able to scan. */ \ T(Illegal, "ILLEGAL", 0) \ \ @@ -288,7 +285,6 @@ public: static bool isLocationSpecifier(Value op) { return op == Memory || op == Storage; } static bool isEtherSubdenomination(Value op) { return op == SubWei || op == SubSzabo || op == SubFinney || op == SubEther; } static bool isTimeSubdenomination(Value op) { return op == SubSecond || op == SubMinute || op == SubHour || op == SubDay || op == SubWeek || op == SubYear; } - static bool isDeprecated(Value op) { return op == After; } // @returns a string corresponding to the JS token string // (.e., "<" for the token LT) or NULL if the token doesn't From faf0b3f66905ccf24b64515d2d9ebdb10e48a89d Mon Sep 17 00:00:00 2001 From: Denton Liu Date: Tue, 9 Aug 2016 10:27:50 -0400 Subject: [PATCH 5/8] Remove After from Types.cpp --- libsolidity/ast/Types.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index 28f7e1b7e..d86a2caf1 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -306,7 +306,7 @@ TypePointer IntegerType::unaryOperatorResult(Token::Value _operator) const // for non-address integers, we allow +, -, ++ and -- else if (_operator == Token::Add || _operator == Token::Sub || _operator == Token::Inc || _operator == Token::Dec || - _operator == Token::After || _operator == Token::BitNot) + _operator == Token::BitNot) return shared_from_this(); else return TypePointer(); @@ -416,8 +416,7 @@ TypePointer FixedPointType::unaryOperatorResult(Token::Value _operator) const _operator == Token::Add || _operator == Token::Sub || _operator == Token::Inc || - _operator == Token::Dec || - _operator == Token::After + _operator == Token::Dec ) return shared_from_this(); else From 1ff7ba0b061da29b23cc6418424bf2c2bc66be11 Mon Sep 17 00:00:00 2001 From: Denton Liu Date: Wed, 10 Aug 2016 15:09:28 -0400 Subject: [PATCH 6/8] Remove after keyword from documentation --- docs/miscellaneous.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/miscellaneous.rst b/docs/miscellaneous.rst index 304fce14c..ca0cf5930 100644 --- a/docs/miscellaneous.rst +++ b/docs/miscellaneous.rst @@ -228,7 +228,7 @@ The following is the order of precedence for operators, listed in order of evalu + +-------------------------------------+--------------------------------------------+ | | Unary plus and minus | ``+``, ``-`` | + +-------------------------------------+--------------------------------------------+ -| | Unary operations | ``after``, ``delete`` | +| | Unary operations | ``delete`` | + +-------------------------------------+--------------------------------------------+ | | Logical NOT | ``!`` | + +-------------------------------------+--------------------------------------------+ @@ -321,4 +321,3 @@ Modifiers - ``constant`` for functions: Disallows modification of state - this is not enforced yet. - ``anonymous`` for events: Does not store event signature as topic. - ``indexed`` for event parameters: Stores the parameter as topic. - From 58d37f24aedc3c045396704da5353896af362ff4 Mon Sep 17 00:00:00 2001 From: Denton Liu Date: Wed, 10 Aug 2016 15:28:06 -0400 Subject: [PATCH 7/8] Remove After test case --- test/libsolidity/SolidityScanner.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/test/libsolidity/SolidityScanner.cpp b/test/libsolidity/SolidityScanner.cpp index 4443b9f6b..624614d2a 100644 --- a/test/libsolidity/SolidityScanner.cpp +++ b/test/libsolidity/SolidityScanner.cpp @@ -275,12 +275,6 @@ BOOST_AUTO_TEST_CASE(time_subdenominations) BOOST_CHECK_EQUAL(scanner.next(), Token::SubYear); } -BOOST_AUTO_TEST_CASE(time_after) -{ - Scanner scanner(CharStream("after 1")); - BOOST_CHECK_EQUAL(scanner.currentToken(), Token::After); -} - BOOST_AUTO_TEST_CASE(empty_comment) { Scanner scanner(CharStream("//\ncontract{}")); From 92a711c4fb0f84186aeab955150a733bb1293aae Mon Sep 17 00:00:00 2001 From: Denton Liu Date: Wed, 10 Aug 2016 16:25:17 -0400 Subject: [PATCH 8/8] Remove after from grammar.txt --- libsolidity/grammar.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsolidity/grammar.txt b/libsolidity/grammar.txt index 6d92fc59d..0d1f68a63 100644 --- a/libsolidity/grammar.txt +++ b/libsolidity/grammar.txt @@ -56,7 +56,7 @@ VariableDefinition = VariableDeclaration ( '=' Expression )? // Precedence by order (see github.com/ethereum/solidity/pull/732) Expression = ( Expression ('++' | '--') | FunctionCall | IndexAccess | MemberAccess | '(' Expression ')' ) - | ('!' | '~' | 'after' | 'delete' | '++' | '--' | '+' | '-') Expression + | ('!' | '~' | 'delete' | '++' | '--' | '+' | '-') Expression | Expression '**' Expression | Expression ('*' | '/' | '%') Expression | Expression ('+' | '-') Expression