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

Side by Side Diff: pkg/compiler/lib/src/parser/partial_elements.dart

Issue 1363993004: Report info messages together with their error, warning, or hint. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment. Created 5 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
« no previous file with comments | « pkg/compiler/lib/src/parser/node_listener.dart ('k') | pkg/compiler/lib/src/patch_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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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.parser.partial_elements; 5 library dart2js.parser.partial_elements;
6 6
7 import '../compiler.dart' show 7 import '../compiler.dart' show
8 Compiler; 8 Compiler;
9 import '../dart_types.dart' show DynamicType; 9 import '../dart_types.dart' show DynamicType;
10 import '../diagnostics/diagnostic_listener.dart'; 10 import '../diagnostics/diagnostic_listener.dart';
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 definitions = parse( 274 definitions = parse(
275 listener, element, declarationSite, 275 listener, element, declarationSite,
276 (Parser parser) => parser.parseMember(beginToken)); 276 (Parser parser) => parser.parseMember(beginToken));
277 277
278 if (!hasParseError && 278 if (!hasParseError &&
279 !definitions.modifiers.isVar && 279 !definitions.modifiers.isVar &&
280 !definitions.modifiers.isFinal && 280 !definitions.modifiers.isFinal &&
281 !definitions.modifiers.isConst && 281 !definitions.modifiers.isConst &&
282 definitions.type == null && 282 definitions.type == null &&
283 !definitions.isErroneous) { 283 !definitions.isErroneous) {
284 listener.reportError( 284 listener.reportErrorMessage(
285 definitions, 285 definitions,
286 MessageKind.GENERIC, 286 MessageKind.GENERIC,
287 { 'text': 'A field declaration must start with var, final, ' 287 { 'text': 'A field declaration must start with var, final, '
288 'const, or a type annotation.' }); 288 'const, or a type annotation.' });
289 } 289 }
290 }); 290 });
291 return definitions; 291 return definitions;
292 } 292 }
293 293
294 computeType(Element element, Compiler compiler) { 294 computeType(Element element, Compiler compiler) {
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 } 490 }
491 doParse(new Parser(listener)); 491 doParse(new Parser(listener));
492 } on ParserError catch (e) { 492 } on ParserError catch (e) {
493 partial.hasParseError = true; 493 partial.hasParseError = true;
494 return new ErrorNode(element.position, e.reason); 494 return new ErrorNode(element.position, e.reason);
495 } 495 }
496 Node node = listener.popNode(); 496 Node node = listener.popNode();
497 assert(listener.nodes.isEmpty); 497 assert(listener.nodes.isEmpty);
498 return node; 498 return node;
499 } 499 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/parser/node_listener.dart ('k') | pkg/compiler/lib/src/patch_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698