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

Side by Side Diff: dart/sdk/lib/_internal/compiler/implementation/tree/nodes.dart

Issue 246963005: Change ErrorNode to masquerade as a null literal. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r35381 and exception for MessageKind.UNMATCHED_TOKEN. Created 6 years, 8 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 | « no previous file | dart/sdk/lib/_internal/compiler/implementation/warnings.dart » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of tree; 5 part of tree;
6 6
7 abstract class Visitor<R> { 7 abstract class Visitor<R> {
8 const Visitor(); 8 const Visitor();
9 9
10 R visitNode(Node node); 10 R visitNode(Node node);
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 Statement(); 312 Statement();
313 313
314 Statement asStatement() => this; 314 Statement asStatement() => this;
315 315
316 // TODO(ahe): make class abstract instead of adding an abstract method. 316 // TODO(ahe): make class abstract instead of adding an abstract method.
317 accept(Visitor visitor); 317 accept(Visitor visitor);
318 318
319 bool isValidBreakTarget() => true; 319 bool isValidBreakTarget() => true;
320 } 320 }
321 321
322 /// Errorneous expression that behaves as a literal integer (0). 322 /// Errorneous expression that behaves as a literal null.
323 class ErrorExpression extends LiteralInt { 323 class ErrorExpression extends LiteralNull {
324 ErrorExpression(token) 324 ErrorExpression(token)
325 : super(token, null); 325 : super(token);
326 326
327 ErrorExpression asErrorExpression() => this; 327 ErrorExpression asErrorExpression() => this;
328
329 int get value => 0;
330 } 328 }
331 329
332 /** 330 /**
333 * A message send aka method invocation. In Dart, most operations can 331 * A message send aka method invocation. In Dart, most operations can
334 * (and should) be considered as message sends. Getters and setters 332 * (and should) be considered as message sends. Getters and setters
335 * are just methods with a special syntax. Consequently, we model 333 * are just methods with a special syntax. Consequently, we model
336 * property access, assignment, operators, and method calls with this 334 * property access, assignment, operators, and method calls with this
337 * one node. 335 * one node.
338 */ 336 */
339 class Send extends Expression { 337 class Send extends Expression {
(...skipping 1767 matching lines...) Expand 10 before | Expand all | Expand 10 after
2107 } 2105 }
2108 2106
2109 class IsInterpolationVisitor extends Visitor<bool> { 2107 class IsInterpolationVisitor extends Visitor<bool> {
2110 const IsInterpolationVisitor(); 2108 const IsInterpolationVisitor();
2111 bool visitNode(Node node) => false; 2109 bool visitNode(Node node) => false;
2112 bool visitStringInterpolation(StringInterpolation node) => true; 2110 bool visitStringInterpolation(StringInterpolation node) => true;
2113 bool visitStringJuxtaposition(StringJuxtaposition node) 2111 bool visitStringJuxtaposition(StringJuxtaposition node)
2114 => node.isInterpolation; 2112 => node.isInterpolation;
2115 } 2113 }
2116 2114
OLDNEW
« no previous file with comments | « no previous file | dart/sdk/lib/_internal/compiler/implementation/warnings.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698