| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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('leg_apiimpl'); | 5 #library('leg_apiimpl'); |
| 6 | 6 |
| 7 #import('dart:uri'); | 7 #import('dart:uri'); |
| 8 | 8 |
| 9 #import('../compiler.dart', prefix: 'api'); | 9 #import('../compiler.dart', prefix: 'api'); |
| 10 #import('leg.dart', prefix: 'leg'); | 10 #import('leg.dart', prefix: 'leg'); |
| 11 #import('tree/tree.dart', prefix: 'tree'); | 11 #import('tree/tree.dart', prefix: 'tree'); |
| 12 #import('elements/elements.dart', prefix: 'elements'); | 12 #import('elements/elements.dart', prefix: 'elements'); |
| 13 #import('ssa/tracer.dart', prefix: 'ssa'); | 13 #import('ssa/tracer.dart', prefix: 'ssa'); |
| 14 #import('library_map.dart'); | 14 #import('library_map.dart'); |
| 15 #import('source_file.dart'); | 15 #import('source_file.dart'); |
| 16 | 16 |
| 17 class Compiler extends leg.Compiler { | 17 class Compiler extends leg.Compiler { |
| 18 api.ReadUriFromString provider; | 18 api.ReadStringFromUri provider; |
| 19 api.DiagnosticHandler handler; | 19 api.DiagnosticHandler handler; |
| 20 final Uri libraryRoot; | 20 final Uri libraryRoot; |
| 21 final Uri packageRoot; | 21 final Uri packageRoot; |
| 22 List<String> options; | 22 List<String> options; |
| 23 bool mockableLibraryUsed = false; | 23 bool mockableLibraryUsed = false; |
| 24 | 24 |
| 25 Compiler(this.provider, this.handler, this.libraryRoot, this.packageRoot, | 25 Compiler(this.provider, this.handler, this.libraryRoot, this.packageRoot, |
| 26 List<String> options) | 26 List<String> options) |
| 27 : this.options = options, | 27 : this.options = options, |
| 28 super( | 28 super( |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 handler(translateUri(span.uri, null), span.begin, span.end, | 102 handler(translateUri(span.uri, null), span.begin, span.end, |
| 103 message, fatal); | 103 message, fatal); |
| 104 } | 104 } |
| 105 } | 105 } |
| 106 | 106 |
| 107 bool get isMockCompilation() { | 107 bool get isMockCompilation() { |
| 108 return mockableLibraryUsed | 108 return mockableLibraryUsed |
| 109 && (options.indexOf('--allow-mock-compilation') !== -1); | 109 && (options.indexOf('--allow-mock-compilation') !== -1); |
| 110 } | 110 } |
| 111 } | 111 } |
| OLD | NEW |