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

Side by Side Diff: pkg/analyzer/lib/src/generated/parser.dart

Issue 1700243002: Share const-error messages. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Use double-quotes Created 4 years, 10 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 analyzer.src.generated.parser; 5 library analyzer.src.generated.parser;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import "dart:math" as math; 8 import "dart:math" as math;
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 9377 matching lines...) Expand 10 before | Expand all | Expand 10 after
9388 * Some environments, such as Fletch, do not support async. 9388 * Some environments, such as Fletch, do not support async.
9389 */ 9389 */
9390 static const ParserErrorCode ASYNC_NOT_SUPPORTED = const ParserErrorCode( 9390 static const ParserErrorCode ASYNC_NOT_SUPPORTED = const ParserErrorCode(
9391 'ASYNC_NOT_SUPPORTED', 9391 'ASYNC_NOT_SUPPORTED',
9392 "Async and sync are not supported in this environment."); 9392 "Async and sync are not supported in this environment.");
9393 9393
9394 static const ParserErrorCode BREAK_OUTSIDE_OF_LOOP = const ParserErrorCode( 9394 static const ParserErrorCode BREAK_OUTSIDE_OF_LOOP = const ParserErrorCode(
9395 'BREAK_OUTSIDE_OF_LOOP', 9395 'BREAK_OUTSIDE_OF_LOOP',
9396 "A break statement cannot be used outside of a loop or switch statement"); 9396 "A break statement cannot be used outside of a loop or switch statement");
9397 9397
9398 static const ParserErrorCode CLASS_IN_CLASS = const ParserErrorCode( 9398 static const ParserErrorCode CLASS_IN_CLASS = shared_messages.CLASS_IN_CLASS;
9399 'CLASS_IN_CLASS', "Classes cannot be declared inside other classes");
9400 9399
9401 static const ParserErrorCode COLON_IN_PLACE_OF_IN = const ParserErrorCode( 9400 static const ParserErrorCode COLON_IN_PLACE_OF_IN = const ParserErrorCode(
9402 'COLON_IN_PLACE_OF_IN', "For-in loops use 'in' rather than a colon"); 9401 'COLON_IN_PLACE_OF_IN', "For-in loops use 'in' rather than a colon");
9403 9402
9404 static const ParserErrorCode CONST_AND_FINAL = const ParserErrorCode( 9403 static const ParserErrorCode CONST_AND_FINAL =
9405 'CONST_AND_FINAL', 9404 shared_messages.CONST_AND_FINAL;
9406 "Members cannot be declared to be both 'const' and 'final'");
9407 9405
9408 static const ParserErrorCode CONST_AND_VAR = const ParserErrorCode( 9406 static const ParserErrorCode CONST_AND_VAR = shared_messages.CONST_AND_VAR;
9409 'CONST_AND_VAR',
9410 "Members cannot be declared to be both 'const' and 'var'");
9411 9407
9412 static const ParserErrorCode CONST_CLASS = const ParserErrorCode( 9408 static const ParserErrorCode CONST_CLASS = shared_messages.CONST_CLASS;
9413 'CONST_CLASS', "Classes cannot be declared to be 'const'");
9414 9409
9415 static const ParserErrorCode CONST_CONSTRUCTOR_WITH_BODY = 9410 static const ParserErrorCode CONST_CONSTRUCTOR_WITH_BODY =
9416 shared_messages.CONST_CONSTRUCTOR_WITH_BODY; 9411 shared_messages.CONST_CONSTRUCTOR_WITH_BODY;
9417 9412
9418 static const ParserErrorCode CONST_ENUM = const ParserErrorCode( 9413 static const ParserErrorCode CONST_ENUM = shared_messages.CONST_ENUM;
9419 'CONST_ENUM', "Enums cannot be declared to be 'const'");
9420 9414
9421 static const ParserErrorCode CONST_FACTORY = shared_messages.CONST_FACTORY; 9415 static const ParserErrorCode CONST_FACTORY = shared_messages.CONST_FACTORY;
9422 9416
9423 static const ParserErrorCode CONST_METHOD = const ParserErrorCode( 9417 static const ParserErrorCode CONST_METHOD = shared_messages.CONST_METHOD;
9424 'CONST_METHOD',
9425 "Getters, setters and methods cannot be declared to be 'const'");
9426 9418
9427 static const ParserErrorCode CONST_TYPEDEF = const ParserErrorCode( 9419 static const ParserErrorCode CONST_TYPEDEF = shared_messages.CONST_TYPEDEF;
9428 'CONST_TYPEDEF', "Type aliases cannot be declared to be 'const'");
9429 9420
9430 static const ParserErrorCode CONSTRUCTOR_WITH_RETURN_TYPE = 9421 static const ParserErrorCode CONSTRUCTOR_WITH_RETURN_TYPE =
9431 const ParserErrorCode('CONSTRUCTOR_WITH_RETURN_TYPE', 9422 shared_messages.CONSTRUCTOR_WITH_RETURN_TYPE;
9432 "Constructors cannot have a return type");
9433 9423
9434 static const ParserErrorCode CONTINUE_OUTSIDE_OF_LOOP = const ParserErrorCode( 9424 static const ParserErrorCode CONTINUE_OUTSIDE_OF_LOOP = const ParserErrorCode(
9435 'CONTINUE_OUTSIDE_OF_LOOP', 9425 'CONTINUE_OUTSIDE_OF_LOOP',
9436 "A continue statement cannot be used outside of a loop or switch statement "); 9426 "A continue statement cannot be used outside of a loop or switch statement ");
9437 9427
9438 static const ParserErrorCode CONTINUE_WITHOUT_LABEL_IN_CASE = 9428 static const ParserErrorCode CONTINUE_WITHOUT_LABEL_IN_CASE =
9439 const ParserErrorCode('CONTINUE_WITHOUT_LABEL_IN_CASE', 9429 const ParserErrorCode('CONTINUE_WITHOUT_LABEL_IN_CASE',
9440 "A continue statement in a switch statement must have a label as a tar get"); 9430 "A continue statement in a switch statement must have a label as a tar get");
9441 9431
9442 static const ParserErrorCode DEPRECATED_CLASS_TYPE_ALIAS = 9432 static const ParserErrorCode DEPRECATED_CLASS_TYPE_ALIAS =
(...skipping 1916 matching lines...) Expand 10 before | Expand all | Expand 10 after
11359 } 11349 }
11360 11350
11361 /** 11351 /**
11362 * Copy resolution data from the [fromNode] to the [toNode]. 11352 * Copy resolution data from the [fromNode] to the [toNode].
11363 */ 11353 */
11364 static void copyResolutionData(AstNode fromNode, AstNode toNode) { 11354 static void copyResolutionData(AstNode fromNode, AstNode toNode) {
11365 ResolutionCopier copier = new ResolutionCopier(); 11355 ResolutionCopier copier = new ResolutionCopier();
11366 copier._isEqualNodes(fromNode, toNode); 11356 copier._isEqualNodes(fromNode, toNode);
11367 } 11357 }
11368 } 11358 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698