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

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

Issue 1392383002: further refactoring: merge RestrictedRules into TypeRules (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: rebase Created 5 years, 2 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/strong_mode.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 /// Command line tool to run the checker on a Dart program. 5 /// Command line tool to run the checker on a Dart program.
6 library dev_compiler.src.compiler; 6 library dev_compiler.src.compiler;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:collection'; 9 import 'dart:collection';
10 import 'dart:math' as math; 10 import 'dart:math' as math;
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 abstract class AbstractCompiler { 345 abstract class AbstractCompiler {
346 final CompilerOptions options; 346 final CompilerOptions options;
347 final AnalysisContext context; 347 final AnalysisContext context;
348 final CodeChecker checker; 348 final CodeChecker checker;
349 349
350 AbstractCompiler(AnalysisContext context, CompilerOptions options, 350 AbstractCompiler(AnalysisContext context, CompilerOptions options,
351 [AnalysisErrorListener reporter]) 351 [AnalysisErrorListener reporter])
352 : context = context, 352 : context = context,
353 options = options, 353 options = options,
354 checker = new CodeChecker( 354 checker = new CodeChecker(
355 new RestrictedRules(context.typeProvider, 355 new TypeRules(context.typeProvider, options: options.strongOptions),
356 options: options.strongOptions),
357 reporter ?? AnalysisErrorListener.NULL_LISTENER); 356 reporter ?? AnalysisErrorListener.NULL_LISTENER);
358 357
359 String get outputDir => options.codegenOptions.outputDir; 358 String get outputDir => options.codegenOptions.outputDir;
360 TypeRules get rules => checker.rules; 359 TypeRules get rules => checker.rules;
361 AnalysisErrorListener get reporter => checker.reporter; 360 AnalysisErrorListener get reporter => checker.reporter;
362 361
363 Uri stringToUri(String uriString) { 362 Uri stringToUri(String uriString) {
364 var uri = uriString.startsWith('dart:') || uriString.startsWith('package:') 363 var uri = uriString.startsWith('dart:') || uriString.startsWith('package:')
365 ? Uri.parse(uriString) 364 ? Uri.parse(uriString)
366 : new Uri.file(path.absolute(uriString)); 365 : new Uri.file(path.absolute(uriString));
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 '_rtti.js', 512 '_rtti.js',
514 '_classes.js', 513 '_classes.js',
515 '_operations.js', 514 '_operations.js',
516 'dart_runtime.js', 515 'dart_runtime.js',
517 ]; 516 ];
518 files.addAll(corelibOrder.map((l) => l.replaceAll('.', '/') + '.js')); 517 files.addAll(corelibOrder.map((l) => l.replaceAll('.', '/') + '.js'));
519 return files; 518 return files;
520 }(); 519 }();
521 520
522 final _log = new Logger('dev_compiler.src.compiler'); 521 final _log = new Logger('dev_compiler.src.compiler');
OLDNEW
« no previous file with comments | « lib/src/checker/rules.dart ('k') | lib/strong_mode.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698