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

Side by Side Diff: pkg/compiler/lib/src/tree/unparser.dart

Issue 2747683003: update fasta scanner to always generate INDEX or INDEX_EQ tokens (Closed)
Patch Set: merge Created 3 years, 9 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
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/parser/parser.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 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
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.lexeme); 389 // if the NodeList is a single "[]" token
ahe 2017/06/01 14:45:01 if -> If
390 // then beginToken == endToken and only write beginToken.
391 if (node.endToken != null && node.endToken != node.beginToken) {
392 write(node.endToken.lexeme);
393 }
390 } 394 }
391 395
392 visitNodeList(NodeList node) { 396 visitNodeList(NodeList node) {
393 unparseNodeList(node); 397 unparseNodeList(node);
394 } 398 }
395 399
396 visitOperator(Operator node) { 400 visitOperator(Operator node) {
397 visitIdentifier(node); 401 visitIdentifier(node);
398 } 402 }
399 403
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 } 913 }
910 914
911 visitStringNode(StringNode node) { 915 visitStringNode(StringNode node) {
912 throw 'internal error'; // Should not be called. 916 throw 'internal error'; // Should not be called.
913 } 917 }
914 918
915 visitTypeAnnotation(TypeAnnotation node) { 919 visitTypeAnnotation(TypeAnnotation node) {
916 throw 'internal error'; // Should not be called. 920 throw 'internal error'; // Should not be called.
917 } 921 }
918 } 922 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/parser/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698