Merge pull request #844 from Denton-L/remove-after

BREAKING: Remove after
This commit is contained in:
chriseth 2016-08-12 15:09:55 +02:00 committed by GitHub
commit 0d894a6832
6 changed files with 6 additions and 17 deletions

View File

@ -228,7 +228,7 @@ The following is the order of precedence for operators, listed in order of evalu
+ +-------------------------------------+--------------------------------------------+ + +-------------------------------------+--------------------------------------------+
| | Unary plus and minus | ``+``, ``-`` | | | Unary plus and minus | ``+``, ``-`` |
+ +-------------------------------------+--------------------------------------------+ + +-------------------------------------+--------------------------------------------+
| | Unary operations | ``after``, ``delete`` | | | Unary operations | ``delete`` |
+ +-------------------------------------+--------------------------------------------+ + +-------------------------------------+--------------------------------------------+
| | Logical NOT | ``!`` | | | Logical NOT | ``!`` |
+ +-------------------------------------+--------------------------------------------+ + +-------------------------------------+--------------------------------------------+
@ -321,4 +321,3 @@ Modifiers
- ``constant`` for functions: Disallows modification of state - this is not enforced yet. - ``constant`` for functions: Disallows modification of state - this is not enforced yet.
- ``anonymous`` for events: Does not store event signature as topic. - ``anonymous`` for events: Does not store event signature as topic.
- ``indexed`` for event parameters: Stores the parameter as topic. - ``indexed`` for event parameters: Stores the parameter as topic.

View File

@ -306,7 +306,7 @@ TypePointer IntegerType::unaryOperatorResult(Token::Value _operator) const
// for non-address integers, we allow +, -, ++ and -- // for non-address integers, we allow +, -, ++ and --
else if (_operator == Token::Add || _operator == Token::Sub || else if (_operator == Token::Add || _operator == Token::Sub ||
_operator == Token::Inc || _operator == Token::Dec || _operator == Token::Inc || _operator == Token::Dec ||
_operator == Token::After || _operator == Token::BitNot) _operator == Token::BitNot)
return shared_from_this(); return shared_from_this();
else else
return TypePointer(); return TypePointer();
@ -416,8 +416,7 @@ TypePointer FixedPointType::unaryOperatorResult(Token::Value _operator) const
_operator == Token::Add || _operator == Token::Add ||
_operator == Token::Sub || _operator == Token::Sub ||
_operator == Token::Inc || _operator == Token::Inc ||
_operator == Token::Dec || _operator == Token::Dec
_operator == Token::After
) )
return shared_from_this(); return shared_from_this();
else else

View File

@ -297,9 +297,6 @@ bool ExpressionCompiler::visit(UnaryOperation const& _unaryOperation)
case Token::BitNot: // ~ case Token::BitNot: // ~
m_context << Instruction::NOT; m_context << Instruction::NOT;
break; break;
case Token::After: // after
m_context << Instruction::TIMESTAMP << Instruction::ADD;
break;
case Token::Delete: // delete case Token::Delete: // delete
solAssert(!!m_currentLValue, "LValue not retrieved."); solAssert(!!m_currentLValue, "LValue not retrieved.");
m_currentLValue->setToZero(_unaryOperation.location()); m_currentLValue->setToZero(_unaryOperation.location());

View File

@ -56,7 +56,7 @@ VariableDefinition = VariableDeclaration ( '=' Expression )?
// Precedence by order (see github.com/ethereum/solidity/pull/732) // Precedence by order (see github.com/ethereum/solidity/pull/732)
Expression = Expression =
( Expression ('++' | '--') | FunctionCall | IndexAccess | MemberAccess | '(' Expression ')' ) ( Expression ('++' | '--') | FunctionCall | IndexAccess | MemberAccess | '(' Expression ')' )
| ('!' | '~' | 'after' | 'delete' | '++' | '--' | '+' | '-') Expression | ('!' | '~' | 'delete' | '++' | '--' | '+' | '-') Expression
| Expression '**' Expression | Expression '**' Expression
| Expression ('*' | '/' | '%') Expression | Expression ('*' | '/' | '%') Expression
| Expression ('+' | '-') Expression | Expression ('+' | '-') Expression

View File

@ -185,7 +185,6 @@ namespace solidity
K(SubDay, "days", 0) \ K(SubDay, "days", 0) \
K(SubWeek, "weeks", 0) \ K(SubWeek, "weeks", 0) \
K(SubYear, "years", 0) \ K(SubYear, "years", 0) \
K(After, "after", 0) \
/* type keywords*/ \ /* type keywords*/ \
K(Int, "int", 0) \ K(Int, "int", 0) \
K(UInt, "uint", 0) \ K(UInt, "uint", 0) \
@ -215,6 +214,7 @@ namespace solidity
T(Identifier, NULL, 0) \ T(Identifier, NULL, 0) \
\ \
/* Keywords reserved for future use. */ \ /* Keywords reserved for future use. */ \
K(After, "after", 0) \
K(As, "as", 0) \ K(As, "as", 0) \
K(Case, "case", 0) \ K(Case, "case", 0) \
K(Catch, "catch", 0) \ K(Catch, "catch", 0) \
@ -277,7 +277,7 @@ public:
static bool isBitOp(Value op) { return (BitOr <= op && op <= BitAnd) || op == BitNot; } 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 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 isCountOp(Value op) { return op == Inc || op == Dec; }
static bool isShiftOp(Value op) { return (SHL <= op) && (op <= SHR); } static bool isShiftOp(Value op) { return (SHL <= op) && (op <= SHR); }
static bool isVisibilitySpecifier(Value op) { return isVariableVisibilitySpecifier(op) || op == External; } static bool isVisibilitySpecifier(Value op) { return isVariableVisibilitySpecifier(op) || op == External; }

View File

@ -275,12 +275,6 @@ BOOST_AUTO_TEST_CASE(time_subdenominations)
BOOST_CHECK_EQUAL(scanner.next(), Token::SubYear); 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) BOOST_AUTO_TEST_CASE(empty_comment)
{ {
Scanner scanner(CharStream("//\ncontract{}")); Scanner scanner(CharStream("//\ncontract{}"));