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

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

Issue 2746543007: Revert "update fasta scanner to always generate INDEX or INDEX_EQ tokens" (Closed)
Patch Set: 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 "[]" then beginToken == endToken ... only write beginToken 389 if (node.endToken != null) write(node.endToken.lexeme);
390 if (node.endToken != null && node.endToken != node.beginToken) {
391 write(node.endToken.lexeme);
392 }
393 } 390 }
394 391
395 visitNodeList(NodeList node) { 392 visitNodeList(NodeList node) {
396 unparseNodeList(node); 393 unparseNodeList(node);
397 } 394 }
398 395
399 visitOperator(Operator node) { 396 visitOperator(Operator node) {
400 visitIdentifier(node); 397 visitIdentifier(node);
401 } 398 }
402 399
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 } 909 }
913 910
914 visitStringNode(StringNode node) { 911 visitStringNode(StringNode node) {
915 throw 'internal error'; // Should not be called. 912 throw 'internal error'; // Should not be called.
916 } 913 }
917 914
918 visitTypeAnnotation(TypeAnnotation node) { 915 visitTypeAnnotation(TypeAnnotation node) {
919 throw 'internal error'; // Should not be called. 916 throw 'internal error'; // Should not be called.
920 } 917 }
921 } 918 }
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