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

Side by Side Diff: lib/src/codegen/code_generator.dart

Issue 1067553004: Factor out reporting from rules (Closed) Base URL: git@github.com:dart-lang/dart-dev-compiler.git@master
Patch Set: Change set/get pair to field Created 5 years, 8 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/checker/rules.dart ('k') | lib/src/codegen/dart_codegen.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 dev_compiler.src.codegen.code_generator; 5 library dev_compiler.src.codegen.code_generator;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:analyzer/src/generated/ast.dart' show CompilationUnit; 9 import 'package:analyzer/src/generated/ast.dart' show CompilationUnit;
10 import 'package:analyzer/src/generated/element.dart' 10 import 'package:analyzer/src/generated/element.dart'
11 show CompilationUnitElement, LibraryElement; 11 show CompilationUnitElement, LibraryElement;
12 import 'package:path/path.dart' as path; 12 import 'package:path/path.dart' as path;
13 13
14 import 'package:dev_compiler/src/info.dart'; 14 import 'package:dev_compiler/src/info.dart';
15 import 'package:dev_compiler/src/utils.dart' show canonicalLibraryName; 15 import 'package:dev_compiler/src/utils.dart' show canonicalLibraryName;
16 import 'package:dev_compiler/src/report.dart';
17 import 'package:dev_compiler/src/checker/rules.dart'; 16 import 'package:dev_compiler/src/checker/rules.dart';
18 17
19 abstract class CodeGenerator { 18 abstract class CodeGenerator {
20 final String outDir; 19 final String outDir;
21 final Uri root; 20 final Uri root;
22 final TypeRules rules; 21 final TypeRules rules;
23 22
24 static List<String> _searchPaths = () { 23 static List<String> _searchPaths = () {
25 // TODO(vsm): Can we remove redundancy with multi_package_resolver logic? 24 // TODO(vsm): Can we remove redundancy with multi_package_resolver logic?
26 var packagePaths = 25 var packagePaths =
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 return new Uri( 124 return new Uri(
126 scheme: 'package', path: path.joinAll(parts.sublist(index + 1))); 125 scheme: 'package', path: path.joinAll(parts.sublist(index + 1)));
127 } 126 }
128 127
129 CodeGenerator(String outDir, this.root, this.rules) 128 CodeGenerator(String outDir, this.root, this.rules)
130 : outDir = path.absolute(outDir); 129 : outDir = path.absolute(outDir);
131 130
132 /// Return a hash, if any, that can be used for caching purposes. When two 131 /// Return a hash, if any, that can be used for caching purposes. When two
133 /// invocations to this function return the same hash, the underlying 132 /// invocations to this function return the same hash, the underlying
134 /// code-generator generated the same code. 133 /// code-generator generated the same code.
135 String generateLibrary( 134 String generateLibrary(LibraryUnit unit, LibraryInfo info);
136 LibraryUnit unit, LibraryInfo info, CheckerReporter reporter);
137 } 135 }
OLDNEW
« no previous file with comments | « lib/src/checker/rules.dart ('k') | lib/src/codegen/dart_codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698