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

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

Issue 1141013002: Fixes #179 -- compile error if editing files during server mode (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 7 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/src/dependency_graph.dart ('k') | lib/src/report.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 /// 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 'dart:mirrors'; 9 import 'dart:mirrors';
10 10
11 import 'package:analyzer/src/generated/ast.dart'; 11 import 'package:analyzer/src/generated/ast.dart';
12 import 'package:analyzer/src/generated/element.dart'; 12 import 'package:analyzer/src/generated/element.dart';
13 import 'package:analyzer/src/generated/error.dart' as analyzer;
13 import 'package:analyzer/src/generated/scanner.dart' 14 import 'package:analyzer/src/generated/scanner.dart'
14 show Token, TokenType, SyntheticStringToken; 15 show Token, TokenType, SyntheticStringToken;
15 import 'package:logging/logging.dart' show Level; 16 import 'package:logging/logging.dart' show Level;
16 17
17 import 'package:dev_compiler/src/checker/rules.dart'; 18 import 'package:dev_compiler/src/checker/rules.dart';
18 import 'package:dev_compiler/src/utils.dart' as utils; 19 import 'package:dev_compiler/src/utils.dart' as utils;
19 20
20 import 'report.dart' show Message; 21 import 'report.dart' show Message;
21 22
22 /// Represents a summary of the results collected by running the program 23 /// Represents a summary of the results collected by running the program
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 for (var cls in declarations.where((d) => d is ClassMirror)) { 724 for (var cls in declarations.where((d) => d is ClassMirror)) {
724 if (cls.isSubtypeOf(infoMirror)) { 725 if (cls.isSubtypeOf(infoMirror)) {
725 allTypes.add(cls); 726 allTypes.add(cls);
726 baseTypes.add(cls.superclass); 727 baseTypes.add(cls.superclass);
727 } 728 }
728 } 729 }
729 allTypes.removeAll(baseTypes); 730 allTypes.removeAll(baseTypes);
730 return new List<Type>.from(allTypes.map((mirror) => mirror.reflectedType)) 731 return new List<Type>.from(allTypes.map((mirror) => mirror.reflectedType))
731 ..sort((t1, t2) => '$t1'.compareTo('$t2')); 732 ..sort((t1, t2) => '$t1'.compareTo('$t2'));
732 }(); 733 }();
734
735 class AnalyzerError extends Message {
736 factory AnalyzerError.from(analyzer.AnalysisError error) {
737 var severity = error.errorCode.type.severity;
738 var isError = severity == analyzer.ErrorSeverity.ERROR;
739 var level = isError ? Level.SEVERE : Level.WARNING;
740 int begin = error.offset;
741 int end = begin + error.length;
742 return new AnalyzerError(error.message, level, begin, end);
743 }
744
745 const AnalyzerError(String message, Level level, int begin, int end)
746 : super('[from analyzer]: $message', level, begin, end);
747 }
OLDNEW
« no previous file with comments | « lib/src/dependency_graph.dart ('k') | lib/src/report.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698