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

Side by Side Diff: runtime/vm/ast.cc

Issue 9264051: Fix for bug 1229: Unary operator plus is not allowed ... except for literals. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/lib/math.cc ('k') | runtime/vm/bigint_operations.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/ast.h" 5 #include "vm/ast.h"
6 #include "vm/compiler.h" 6 #include "vm/compiler.h"
7 #include "vm/dart_entry.h" 7 #include "vm/dart_entry.h"
8 #include "vm/isolate.h" 8 #include "vm/isolate.h"
9 #include "vm/object_store.h" 9 #include "vm/object_store.h"
10 10
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 return NULL; 239 return NULL;
240 default: 240 default:
241 UNREACHABLE(); 241 UNREACHABLE();
242 return NULL; 242 return NULL;
243 } 243 }
244 return NULL; 244 return NULL;
245 } 245 }
246 246
247 247
248 AstNode* UnaryOpNode::UnaryOpOrLiteral(intptr_t token_index, 248 AstNode* UnaryOpNode::UnaryOpOrLiteral(intptr_t token_index,
249 Token::Kind kind, 249 Token::Kind kind,
250 AstNode* operand) { 250 AstNode* operand) {
251 AstNode* new_operand = operand->ApplyUnaryOp(kind); 251 AstNode* new_operand = operand->ApplyUnaryOp(kind);
252 if (new_operand != NULL) { 252 if (new_operand != NULL) {
253 return new_operand; 253 return new_operand;
254 } 254 }
255 return new UnaryOpNode(token_index, kind, operand); 255 return new UnaryOpNode(token_index, kind, operand);
256 } 256 }
257 257
258 258
259 bool UnaryOpNode::IsKindValid() const { 259 bool UnaryOpNode::IsKindValid() const {
260 switch (kind_) { 260 switch (kind_) {
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 if (field_value.IsUnhandledException()) { 445 if (field_value.IsUnhandledException()) {
446 return NULL; 446 return NULL;
447 } 447 }
448 if (!field_value.IsNull()) { 448 if (!field_value.IsNull()) {
449 return &field_value; 449 return &field_value;
450 } 450 }
451 return NULL; 451 return NULL;
452 } 452 }
453 453
454 } // namespace dart 454 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/math.cc ('k') | runtime/vm/bigint_operations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698