Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 import 'package:front_end/src/fasta/scanner.dart' show Token; | 5 import 'package:front_end/src/fasta/scanner.dart' show Token; |
| 6 import 'package:front_end/src/fasta/scanner/token_constants.dart' as Tokens | 6 import 'package:front_end/src/fasta/scanner/token_constants.dart' as Tokens |
| 7 show IDENTIFIER_TOKEN, KEYWORD_TOKEN, PLUS_TOKEN; | 7 show IDENTIFIER_TOKEN, KEYWORD_TOKEN, PLUS_TOKEN; |
| 8 import '../util/util.dart'; | 8 import '../util/util.dart'; |
| 9 import 'nodes.dart'; | 9 import 'nodes.dart'; |
| 10 | 10 |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 379 if (spaces) space(); | 379 if (spaces) space(); |
| 380 visit(link.head); | 380 visit(link.head); |
| 381 } | 381 } |
| 382 } | 382 } |
| 383 | 383 |
| 384 unparseNodeList(NodeList node, {bool spaces: true}) { | 384 unparseNodeList(NodeList node, {bool spaces: true}) { |
| 385 addToken(node.beginToken); | 385 addToken(node.beginToken); |
| 386 if (node.nodes != null) { | 386 if (node.nodes != null) { |
| 387 unparseNodeListFrom(node, node.nodes, spaces: spaces); | 387 unparseNodeListFrom(node, node.nodes, spaces: spaces); |
| 388 } | 388 } |
| 389 if (node.endToken != null) write(node.endToken.value); | 389 // if "[]" then beginToken == endToken ... only write beginToken |
|
ahe
2017/03/09 12:45:18
Change this comment to be a complete sentence. In
danrubel
2017/03/13 14:56:44
Done.
https://codereview.chromium.org/2747683003
| |
| 390 if (node.endToken != null && node.endToken != node.beginToken) { | |
| 391 write(node.endToken.value); | |
| 392 } | |
| 390 } | 393 } |
| 391 | 394 |
| 392 visitNodeList(NodeList node) { | 395 visitNodeList(NodeList node) { |
| 393 unparseNodeList(node); | 396 unparseNodeList(node); |
| 394 } | 397 } |
| 395 | 398 |
| 396 visitOperator(Operator node) { | 399 visitOperator(Operator node) { |
| 397 visitIdentifier(node); | 400 visitIdentifier(node); |
| 398 } | 401 } |
| 399 | 402 |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 909 } | 912 } |
| 910 | 913 |
| 911 visitStringNode(StringNode node) { | 914 visitStringNode(StringNode node) { |
| 912 throw 'internal error'; // Should not be called. | 915 throw 'internal error'; // Should not be called. |
| 913 } | 916 } |
| 914 | 917 |
| 915 visitTypeAnnotation(TypeAnnotation node) { | 918 visitTypeAnnotation(TypeAnnotation node) { |
| 916 throw 'internal error'; // Should not be called. | 919 throw 'internal error'; // Should not be called. |
| 917 } | 920 } |
| 918 } | 921 } |
| OLD | NEW |