Skip to content

Commit 0d894a6

Browse files
authored
Merge pull request #844 from Denton-L/remove-after
BREAKING: Remove after
2 parents 08248ff + 92a711c commit 0d894a6

File tree

6 files changed

+6
-17
lines changed

6 files changed

+6
-17
lines changed

docs/miscellaneous.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ The following is the order of precedence for operators, listed in order of evalu
228228
+ +-------------------------------------+--------------------------------------------+
229229
| | Unary plus and minus | ``+``, ``-`` |
230230
+ +-------------------------------------+--------------------------------------------+
231-
| | Unary operations | ``after``, ``delete`` |
231+
| | Unary operations | ``delete`` |
232232
+ +-------------------------------------+--------------------------------------------+
233233
| | Logical NOT | ``!`` |
234234
+ +-------------------------------------+--------------------------------------------+
@@ -321,4 +321,3 @@ Modifiers
321321
- ``constant`` for functions: Disallows modification of state - this is not enforced yet.
322322
- ``anonymous`` for events: Does not store event signature as topic.
323323
- ``indexed`` for event parameters: Stores the parameter as topic.
324-

libsolidity/ast/Types.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ TypePointer IntegerType::unaryOperatorResult(Token::Value _operator) const
306306
// for non-address integers, we allow +, -, ++ and --
307307
else if (_operator == Token::Add || _operator == Token::Sub ||
308308
_operator == Token::Inc || _operator == Token::Dec ||
309-
_operator == Token::After || _operator == Token::BitNot)
309+
_operator == Token::BitNot)
310310
return shared_from_this();
311311
else
312312
return TypePointer();
@@ -416,8 +416,7 @@ TypePointer FixedPointType::unaryOperatorResult(Token::Value _operator) const
416416
_operator == Token::Add ||
417417
_operator == Token::Sub ||
418418
_operator == Token::Inc ||
419-
_operator == Token::Dec ||
420-
_operator == Token::After
419+
_operator == Token::Dec
421420
)
422421
return shared_from_this();
423422
else

libsolidity/codegen/ExpressionCompiler.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,6 @@ bool ExpressionCompiler::visit(UnaryOperation const& _unaryOperation)
297297
case Token::BitNot: // ~
298298
m_context << Instruction::NOT;
299299
break;
300-
case Token::After: // after
301-
m_context << Instruction::TIMESTAMP << Instruction::ADD;
302-
break;
303300
case Token::Delete: // delete
304301
solAssert(!!m_currentLValue, "LValue not retrieved.");
305302
m_currentLValue->setToZero(_unaryOperation.location());

libsolidity/grammar.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ VariableDefinition = VariableDeclaration ( '=' Expression )?
5656
// Precedence by order (see github.com/ethereum/solidity/pull/732)
5757
Expression =
5858
( Expression ('++' | '--') | FunctionCall | IndexAccess | MemberAccess | '(' Expression ')' )
59-
| ('!' | '~' | 'after' | 'delete' | '++' | '--' | '+' | '-') Expression
59+
| ('!' | '~' | 'delete' | '++' | '--' | '+' | '-') Expression
6060
| Expression '**' Expression
6161
| Expression ('*' | '/' | '%') Expression
6262
| Expression ('+' | '-') Expression

libsolidity/parsing/Token.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ namespace solidity
185185
K(SubDay, "days", 0) \
186186
K(SubWeek, "weeks", 0) \
187187
K(SubYear, "years", 0) \
188-
K(After, "after", 0) \
189188
/* type keywords*/ \
190189
K(Int, "int", 0) \
191190
K(UInt, "uint", 0) \
@@ -215,6 +214,7 @@ namespace solidity
215214
T(Identifier, NULL, 0) \
216215
\
217216
/* Keywords reserved for future use. */ \
217+
K(After, "after", 0) \
218218
K(As, "as", 0) \
219219
K(Case, "case", 0) \
220220
K(Catch, "catch", 0) \
@@ -277,7 +277,7 @@ class Token
277277

278278
static bool isBitOp(Value op) { return (BitOr <= op && op <= BitAnd) || op == BitNot; }
279279
static bool isBooleanOp(Value op) { return (Or <= op && op <= And) || op == Not; }
280-
static bool isUnaryOp(Value op) { return (Not <= op && op <= Delete) || op == Add || op == Sub || op == After; }
280+
static bool isUnaryOp(Value op) { return (Not <= op && op <= Delete) || op == Add || op == Sub; }
281281
static bool isCountOp(Value op) { return op == Inc || op == Dec; }
282282
static bool isShiftOp(Value op) { return (SHL <= op) && (op <= SHR); }
283283
static bool isVisibilitySpecifier(Value op) { return isVariableVisibilitySpecifier(op) || op == External; }

test/libsolidity/SolidityScanner.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,6 @@ BOOST_AUTO_TEST_CASE(time_subdenominations)
275275
BOOST_CHECK_EQUAL(scanner.next(), Token::SubYear);
276276
}
277277

278-
BOOST_AUTO_TEST_CASE(time_after)
279-
{
280-
Scanner scanner(CharStream("after 1"));
281-
BOOST_CHECK_EQUAL(scanner.currentToken(), Token::After);
282-
}
283-
284278
BOOST_AUTO_TEST_CASE(empty_comment)
285279
{
286280
Scanner scanner(CharStream("//\ncontract{}"));

0 commit comments

Comments
 (0)