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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/warnings.dart

Issue 23450044: Update dart2js parser to disallow repeated comparisons and prefix +. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated test expectations and error messages. Created 7 years, 3 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 part of dart2js; 5 part of dart2js;
6 6
7 const DONT_KNOW_HOW_TO_FIX = ""; 7 const DONT_KNOW_HOW_TO_FIX = "";
8 8
9 /** 9 /**
10 * The messages in this file should meet the following guide lines: 10 * The messages in this file should meet the following guide lines:
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 808
809 main() => foo(1); 809 main() => foo(1);
810 """]); 810 """]);
811 811
812 static const MessageKind CONST_WITHOUT_INITIALIZER = const MessageKind( 812 static const MessageKind CONST_WITHOUT_INITIALIZER = const MessageKind(
813 "Error: A constant variable must be initialized.", 813 "Error: A constant variable must be initialized.",
814 howToFix: "Try adding an initializer or " 814 howToFix: "Try adding an initializer or "
815 "removing the 'const' modifier.", 815 "removing the 'const' modifier.",
816 examples: const [""" 816 examples: const ["""
817 void main() { 817 void main() {
818 const c; // This constant variable must be initialized. 818 const c; // This constant variable must be initialized.
819 }"""]); 819 }"""]);
820 820
821 static const MessageKind MEMBER_USES_CLASS_NAME = const MessageKind( 821 static const MessageKind MEMBER_USES_CLASS_NAME = const MessageKind(
822 "Error: Member variable can't have the same name as the class it is " 822 "Error: Member variable can't have the same name as the class it is "
823 "declared in.", 823 "declared in.",
824 howToFix: "Try renaming the variable.", 824 howToFix: "Try renaming the variable.",
825 examples: const [""" 825 examples: const ["""
826 class A { var A; } 826 class A { var A; }
827 main() { 827 main() {
828 var a = new A(); 828 var a = new A();
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 'Error: Library not found "#{resolvedUri}".'); 908 'Error: Library not found "#{resolvedUri}".');
909 909
910 static const MessageKind UNSUPPORTED_EQ_EQ_EQ = const MessageKind( 910 static const MessageKind UNSUPPORTED_EQ_EQ_EQ = const MessageKind(
911 'Error: "===" is not an operator. ' 911 'Error: "===" is not an operator. '
912 'Did you mean "#{lhs} == #{rhs}" or "identical(#{lhs}, #{rhs})"?'); 912 'Did you mean "#{lhs} == #{rhs}" or "identical(#{lhs}, #{rhs})"?');
913 913
914 static const MessageKind UNSUPPORTED_BANG_EQ_EQ = const MessageKind( 914 static const MessageKind UNSUPPORTED_BANG_EQ_EQ = const MessageKind(
915 'Error: "!==" is not an operator. ' 915 'Error: "!==" is not an operator. '
916 'Did you mean "#{lhs} != #{rhs}" or "!identical(#{lhs}, #{rhs})"?'); 916 'Did you mean "#{lhs} != #{rhs}" or "!identical(#{lhs}, #{rhs})"?');
917 917
918 static const MessageKind UNSUPPORTED_PREFIX_PLUS = const MessageKind(
919 "Error: '+' is not a prefix operator. ",
920 howToFix: "Try removing '+'.",
921 examples: const [ "+2 // No longer a valid way to write '2'" ]);
922
918 static const MessageKind UNSUPPORTED_THROW_WITHOUT_EXP = const MessageKind( 923 static const MessageKind UNSUPPORTED_THROW_WITHOUT_EXP = const MessageKind(
919 'Error: No expression after "throw". ' 924 'Error: No expression after "throw". '
920 'Did you mean "rethrow"?'); 925 'Did you mean "rethrow"?');
921 926
922 static const MessageKind MIRRORS_EXPECTED_STRING = const MessageKind( 927 static const MessageKind MIRRORS_EXPECTED_STRING = const MessageKind(
923 "Hint: Can't use '#{name}' here because it's an instance of '#{type}' " 928 "Hint: Can't use '#{name}' here because it's an instance of '#{type}' "
924 "and a 'String' value is expected.", 929 "and a 'String' value is expected.",
925 howToFix: "Did you forget to add quotes?", 930 howToFix: "Did you forget to add quotes?",
926 examples: const [ 931 examples: const [
927 """ 932 """
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 1297
1293 class CompileTimeConstantError extends Diagnostic { 1298 class CompileTimeConstantError extends Diagnostic {
1294 CompileTimeConstantError(MessageKind kind, Map arguments, bool terse) 1299 CompileTimeConstantError(MessageKind kind, Map arguments, bool terse)
1295 : super(kind, arguments, terse); 1300 : super(kind, arguments, terse);
1296 } 1301 }
1297 1302
1298 class CompilationError extends Diagnostic { 1303 class CompilationError extends Diagnostic {
1299 CompilationError(MessageKind kind, Map arguments, bool terse) 1304 CompilationError(MessageKind kind, Map arguments, bool terse)
1300 : super(kind, arguments, terse); 1305 : super(kind, arguments, terse);
1301 } 1306 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/scanner/token.dart ('k') | tests/co19/co19-co19.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698