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

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

Issue 10697003: Various token issues fixed in the compiler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: SendSet.getBeginToken/getEndToken implemented Created 8 years, 5 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 | no next file » | 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 interface Visitor<R> { 5 interface Visitor<R> {
6 R visitBlock(Block node); 6 R visitBlock(Block node);
7 R visitBreakStatement(BreakStatement node); 7 R visitBreakStatement(BreakStatement node);
8 R visitCascade(Cascade node); 8 R visitCascade(Cascade node);
9 R visitCascadeReceiver(CascadeReceiver node); 9 R visitCascadeReceiver(CascadeReceiver node);
10 R visitCaseMatch(CaseMatch node); 10 R visitCaseMatch(CaseMatch node);
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 visitChildren(Visitor visitor) { 342 visitChildren(Visitor visitor) {
343 super.visitChildren(visitor); 343 super.visitChildren(visitor);
344 if (assignmentOperator !== null) assignmentOperator.accept(visitor); 344 if (assignmentOperator !== null) assignmentOperator.accept(visitor);
345 } 345 }
346 346
347 Send copyWithReceiver(Node newReceiver) { 347 Send copyWithReceiver(Node newReceiver) {
348 assert(receiver === null); 348 assert(receiver === null);
349 return new SendSet(newReceiver, selector, assignmentOperator, 349 return new SendSet(newReceiver, selector, assignmentOperator,
350 argumentsNode); 350 argumentsNode);
351 } 351 }
352
353 Token getBeginToken() {
354 if (isPrefix) return assignmentOperator.getBeginToken();
355 return super.getBeginToken();
356 }
357
358 Token getEndToken() {
359 if (isPrefix) return super.getEndToken();
floitsch 2012/06/27 14:06:48 as discussed this won't work in all situations.
360 return assignmentOperator.getEndToken();
361 }
352 } 362 }
353 363
354 class NewExpression extends Expression { 364 class NewExpression extends Expression {
355 /** The token NEW or CONST */ 365 /** The token NEW or CONST */
356 final Token newToken; 366 final Token newToken;
357 367
358 // Note: we expect that send.receiver is null. 368 // Note: we expect that send.receiver is null.
359 final Send send; 369 final Send send;
360 370
361 NewExpression([this.newToken, this.send]); 371 NewExpression([this.newToken, this.send]);
(...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after
1730 * argument). 1740 * argument).
1731 * 1741 *
1732 * TODO(ahe): This method is controversial, the team needs to discuss 1742 * TODO(ahe): This method is controversial, the team needs to discuss
1733 * if top-level methods are acceptable and what naming conventions to 1743 * if top-level methods are acceptable and what naming conventions to
1734 * use. 1744 * use.
1735 */ 1745 */
1736 initializerDo(Node node, f(Node node)) { 1746 initializerDo(Node node, f(Node node)) {
1737 SendSet send = node.asSendSet(); 1747 SendSet send = node.asSendSet();
1738 if (send !== null) return f(send.arguments.head); 1748 if (send !== null) return f(send.arguments.head);
1739 } 1749 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698