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

Side by Side Diff: tests/compiler/dart2js/backend_dart/dart_printer_test.dart

Issue 1383483006: Extract DiagnosticReporter implementation from Compiler. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fixes after rebase. Created 5 years, 2 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library dart_printer_test; 5 library dart_printer_test;
6 6
7 import 'dart:mirrors'; 7 import 'dart:mirrors';
8 import 'package:expect/expect.dart'; 8 import 'package:expect/expect.dart';
9 import 'package:compiler/src/constants/values.dart'; 9 import 'package:compiler/src/constants/values.dart';
10 import 'package:compiler/src/dart_backend/backend_ast_nodes.dart'; 10 import 'package:compiler/src/dart_backend/backend_ast_nodes.dart';
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 buf.write(', '); 44 buf.write(', ');
45 unparse(y); 45 unparse(y);
46 } 46 }
47 buf.write(']'); 47 buf.write(']');
48 } 48 }
49 } 49 }
50 unparse(x); 50 unparse(x);
51 print("${x.runtimeType}: ${buf.toString()}"); 51 print("${x.runtimeType}: ${buf.toString()}");
52 } 52 }
53 53
54 class PrintDiagnosticListener implements DiagnosticListener { 54 class PrintDiagnosticListener implements DiagnosticReporter {
55 void log(message) { 55 void log(message) {
56 print(message); 56 print(message);
57 } 57 }
58 58
59 void internalError(Spannable spannable, message) { 59 void internalError(Spannable spannable, message) {
60 print(message); 60 print(message);
61 } 61 }
62 62
63 SourceSpan spanFromSpannable(Spannable node) { 63 SourceSpan spanFromSpannable(Spannable node) {
64 return new SourceSpan(null, 0, 0); 64 return new SourceSpan(null, 0, 0);
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 checkStatement("do while(x); while (y);"); 979 checkStatement("do while(x); while (y);");
980 checkStatement("{do; while(x); while (y);}"); 980 checkStatement("{do; while(x); while (y);}");
981 981
982 checkStatement('switch(x) { case 1: case 2: return y; }'); 982 checkStatement('switch(x) { case 1: case 2: return y; }');
983 checkStatement('switch(x) { default: return y; }'); 983 checkStatement('switch(x) { default: return y; }');
984 checkStatement('switch(x) { case 1: x=y; default: return y; }'); 984 checkStatement('switch(x) { case 1: x=y; default: return y; }');
985 checkStatement('switch(x) { case 1: x=y; y=z; break; default: return y; }'); 985 checkStatement('switch(x) { case 1: x=y; y=z; break; default: return y; }');
986 986
987 } 987 }
988 988
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/backend_dart/dart_backend_test.dart ('k') | tests/compiler/dart2js/compiler_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698