Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Unified Diff: runtime/vm/parser.cc

Issue 10911206: Remove support for operator negate and replace occurrences with unary (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/integers.dart ('k') | runtime/vm/token.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 23bbf9a4abce4e89afd920907eb1ecbb5eecfc09..437842080ba00e8b5e3838ec2a043d8b8659e1bf 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -2423,8 +2423,7 @@ void Parser::ParseMethodOrConstructor(ClassDesc* members, MemberDesc* method) {
// Now that we know the parameter list, we can distinguish between the
// unary and binary operator -.
if (method->has_operator &&
- ((method->name->Equals(Token::Str(Token::kNEGATE))) ||
- method->name->Equals("-")) &&
+ method->name->Equals("-") &&
(method->params.num_fixed_parameters == 1)) {
// Patch up name for unary operator - so it does not clash with the
// name for binary operator -.
@@ -2769,9 +2768,7 @@ void Parser::CheckOperatorArity(const MemberDesc& member,
} else {
expected_num_parameters = 2;
}
- } else if ((operator_token == Token::kNEGATE) ||
- (operator_token == Token::kBIT_NOT)) {
- // TODO(hausner): Remove support for keyword 'negate'.
+ } else if (operator_token == Token::kBIT_NOT) {
expected_num_parameters = 1;
} else {
expected_num_parameters = 2;
« no previous file with comments | « runtime/lib/integers.dart ('k') | runtime/vm/token.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698