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

Side by Side Diff: tests/compiler/dart2js/message_kind_helper.dart

Issue 340703003: Prevent double reporting on hex, strings, and multiline comments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Comments and comments Created 6 years, 4 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 dart2js.test.message_kind_helper; 5 library dart2js.test.message_kind_helper;
6 6
7 import 'package:expect/expect.dart'; 7 import 'package:expect/expect.dart';
8 import 'dart:async'; 8 import 'dart:async';
9 9
10 import 'package:compiler/implementation/dart2jslib.dart' show 10 import 'package:compiler/implementation/dart2jslib.dart' show
(...skipping 21 matching lines...) Expand all
32 MessageKind.FORMAL_DECLARED_CONST, 32 MessageKind.FORMAL_DECLARED_CONST,
33 MessageKind.FORMAL_DECLARED_STATIC, 33 MessageKind.FORMAL_DECLARED_STATIC,
34 MessageKind.FUNCTION_TYPE_FORMAL_WITH_DEFAULT, 34 MessageKind.FUNCTION_TYPE_FORMAL_WITH_DEFAULT,
35 MessageKind.HIDDEN_IMPLICIT_IMPORT, 35 MessageKind.HIDDEN_IMPLICIT_IMPORT,
36 MessageKind.HIDDEN_IMPORT, 36 MessageKind.HIDDEN_IMPORT,
37 MessageKind.INHERIT_GETTER_AND_METHOD, 37 MessageKind.INHERIT_GETTER_AND_METHOD,
38 MessageKind.UNIMPLEMENTED_METHOD, 38 MessageKind.UNIMPLEMENTED_METHOD,
39 MessageKind.UNIMPLEMENTED_METHOD_ONE, 39 MessageKind.UNIMPLEMENTED_METHOD_ONE,
40 MessageKind.VAR_FUNCTION_TYPE_PARAMETER, 40 MessageKind.VAR_FUNCTION_TYPE_PARAMETER,
41 MessageKind.VOID_NOT_ALLOWED, 41 MessageKind.VOID_NOT_ALLOWED,
42
43 MessageKind.HEX_DIGIT_EXPECTED, // http://dartbug.com/18574
44 MessageKind.UNMATCHED_TOKEN, // http://dartbug.com/18574
45 MessageKind.UNTERMINATED_COMMENT, // http://dartbug.com/18574
46 MessageKind.UNTERMINATED_STRING, // http://dartbug.com/18574
47 ]); 42 ]);
48 43
49 /// Most messages can be tested without causing a fatal error. Add an exception 44 /// Most messages can be tested without causing a fatal error. Add an exception
50 /// here if a fatal error is unavoidable and leads to pending classes. 45 /// here if a fatal error is unavoidable and leads to pending classes.
51 /// Try to avoid adding exceptions here; a fatal error causes the compiler to 46 /// Try to avoid adding exceptions here; a fatal error causes the compiler to
52 /// stop before analyzing all input, and it isn't safe to reuse it. 47 /// stop before analyzing all input, and it isn't safe to reuse it.
53 final Set<MessageKind> kindsWithPendingClasses = new Set<MessageKind>.from([ 48 final Set<MessageKind> kindsWithPendingClasses = new Set<MessageKind>.from([
54 // If you add something here, please file a *new* bug report. 49 // If you add something here, please file a *new* bug report.
55 ]); 50 ]);
56 51
57 /// Most messages can be tested without causing a fatal error. Add an exception 52 /// Most messages can be tested without causing a fatal error. Add an exception
58 /// here if a fatal error is unavoidable. 53 /// here if a fatal error is unavoidable.
59 /// Try to avoid adding exceptions here; a fatal error causes the compiler to 54 /// Try to avoid adding exceptions here; a fatal error causes the compiler to
60 /// stop before analyzing all input, and it isn't safe to reuse it. 55 /// stop before analyzing all input, and it isn't safe to reuse it.
61 final Set<MessageKind> kindsWithFatalErrors = new Set<MessageKind>.from([ 56 final Set<MessageKind> kindsWithFatalErrors = new Set<MessageKind>.from([
62 // If you add something here, please file a *new* bug report. 57 // If you add something here, please file a *new* bug report.
63 MessageKind.HEX_DIGIT_EXPECTED,
64 MessageKind.UNMATCHED_TOKEN, 58 MessageKind.UNMATCHED_TOKEN,
65 MessageKind.UNTERMINATED_STRING, 59 MessageKind.UNTERMINATED_STRING,
66 ]); 60 ]);
67 61
68 Future<Compiler> check(MessageKind kind, Compiler cachedCompiler) { 62 Future<Compiler> check(MessageKind kind, Compiler cachedCompiler) {
69 Expect.isNotNull(kind.howToFix); 63 Expect.isNotNull(kind.howToFix);
70 Expect.isFalse(kind.examples.isEmpty); 64 Expect.isFalse(kind.examples.isEmpty);
71 65
72 return Future.forEach(kind.examples, (example) { 66 return Future.forEach(kind.examples, (example) {
73 if (example is String) { 67 if (example is String) {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 Expect.isTrue(!pendingStuff || kindsWithPendingClasses.contains(kind)); 138 Expect.isTrue(!pendingStuff || kindsWithPendingClasses.contains(kind));
145 139
146 if (!pendingStuff && !compiler.compilerWasCancelled) { 140 if (!pendingStuff && !compiler.compilerWasCancelled) {
147 // If there is pending stuff, or the compiler was cancelled, we 141 // If there is pending stuff, or the compiler was cancelled, we
148 // shouldn't reuse the compiler. 142 // shouldn't reuse the compiler.
149 cachedCompiler = compiler; 143 cachedCompiler = compiler;
150 } 144 }
151 }); 145 });
152 }).then((_) => cachedCompiler); 146 }).then((_) => cachedCompiler);
153 } 147 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/scanner/scanner.dart ('k') | tests/language/bad_raw_string_negative_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698