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

Side by Side Diff: lib/src/info.dart

Issue 1183733004: fixes #25, most analyzer errors were not computed (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 6 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 | « lib/devc.dart ('k') | test/codegen/expect/temps.txt » ('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 /// Defines static information collected by the type checker and used later by 5 /// Defines static information collected by the type checker and used later by
6 /// emitters to generate code. 6 /// emitters to generate code.
7 library dev_compiler.src.info; 7 library dev_compiler.src.info;
8 8
9 import 'package:analyzer/src/generated/ast.dart'; 9 import 'package:analyzer/src/generated/ast.dart';
10 import 'package:analyzer/src/generated/element.dart'; 10 import 'package:analyzer/src/generated/element.dart';
11 import 'package:analyzer/src/generated/error.dart' as analyzer; 11 import 'package:analyzer/src/generated/error.dart'
12 show AnalysisError, ErrorSeverity;
12 import 'package:logging/logging.dart' show Level; 13 import 'package:logging/logging.dart' show Level;
13 14
14 import 'package:dev_compiler/src/checker/rules.dart'; 15 import 'package:dev_compiler/src/checker/rules.dart';
15 import 'package:dev_compiler/src/utils.dart' as utils; 16 import 'package:dev_compiler/src/utils.dart' as utils;
16 17
17 import 'report.dart' show Message; 18 import 'report.dart' show Message;
18 19
19 /// Represents a summary of the results collected by running the program 20 /// Represents a summary of the results collected by running the program
20 /// checker. 21 /// checker.
21 class CheckerResults { 22 class CheckerResults {
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 /// <http://goo.gl/q1T4BB> 522 /// <http://goo.gl/q1T4BB>
522 /// 523 ///
523 /// For now this is the only pattern we support. 524 /// For now this is the only pattern we support.
524 class InvalidSuperInvocation extends StaticError { 525 class InvalidSuperInvocation extends StaticError {
525 InvalidSuperInvocation(SuperConstructorInvocation node) : super(node); 526 InvalidSuperInvocation(SuperConstructorInvocation node) : super(node);
526 527
527 String get message => "super call must be last in an initializer list " 528 String get message => "super call must be last in an initializer list "
528 "(see http://goo.gl/q1T4BB): $node"; 529 "(see http://goo.gl/q1T4BB): $node";
529 } 530 }
530 531
531 class AnalyzerError extends Message { 532 class AnalyzerMessage extends Message {
532 factory AnalyzerError.from(analyzer.AnalysisError error) { 533 factory AnalyzerMessage.from(AnalysisError error) {
533 var severity = error.errorCode.type.severity; 534 var severity = error.errorCode.type.severity;
534 var isError = severity == analyzer.ErrorSeverity.WARNING; 535 var isError = severity == ErrorSeverity.WARNING;
535 var level = isError ? Level.SEVERE : Level.WARNING; 536 var level = isError ? Level.SEVERE : Level.WARNING;
536 int begin = error.offset; 537 int begin = error.offset;
537 int end = begin + error.length; 538 int end = begin + error.length;
538 return new AnalyzerError(error.message, level, begin, end); 539 return new AnalyzerMessage(error.message, level, begin, end);
539 } 540 }
540 541
541 const AnalyzerError(String message, Level level, int begin, int end) 542 const AnalyzerMessage(String message, Level level, int begin, int end)
542 : super(message, level, begin, end); 543 : super(message, level, begin, end);
543 } 544 }
OLDNEW
« no previous file with comments | « lib/devc.dart ('k') | test/codegen/expect/temps.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698