| 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 | 5 |
| 6 /** | 6 /** |
| 7 * If true, print a warning for each method that was resolved, but not | 7 * If true, print a warning for each method that was resolved, but not |
| 8 * compiled. | 8 * compiled. |
| 9 */ | 9 */ |
| 10 const bool REPORT_EXCESS_RESOLUTION = false; | 10 const bool REPORT_EXCESS_RESOLUTION = false; |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 bool compilationFailed = false; | 182 bool compilationFailed = false; |
| 183 | 183 |
| 184 bool hasCrashed = false; | 184 bool hasCrashed = false; |
| 185 | 185 |
| 186 Compiler([this.tracer = const Tracer(), | 186 Compiler([this.tracer = const Tracer(), |
| 187 this.enableTypeAssertions = false, | 187 this.enableTypeAssertions = false, |
| 188 this.enableUserAssertions = false, | 188 this.enableUserAssertions = false, |
| 189 this.enableMinification = false, | 189 this.enableMinification = false, |
| 190 bool emitJavaScript = true, | 190 bool emitJavaScript = true, |
| 191 bool generateSourceMap = true, | 191 bool generateSourceMap = true, |
| 192 bool cutDeclarationTypes = false]) | 192 bool forceCutDeclarationTypes = false]) |
| 193 : libraries = new Map<String, LibraryElement>(), | 193 : libraries = new Map<String, LibraryElement>(), |
| 194 progress = new Stopwatch() { | 194 progress = new Stopwatch() { |
| 195 progress.start(); | 195 progress.start(); |
| 196 world = new World(this); | 196 world = new World(this); |
| 197 scanner = new ScannerTask(this); | 197 scanner = new ScannerTask(this); |
| 198 dietParser = new DietParserTask(this); | 198 dietParser = new DietParserTask(this); |
| 199 parser = new ParserTask(this); | 199 parser = new ParserTask(this); |
| 200 patchParser = new PatchParserTask(this); | 200 patchParser = new PatchParserTask(this); |
| 201 validator = new TreeValidatorTask(this); | 201 validator = new TreeValidatorTask(this); |
| 202 resolver = new ResolverTask(this); | 202 resolver = new ResolverTask(this); |
| 203 closureToClassMapper = new closureMapping.ClosureTask(this); | 203 closureToClassMapper = new closureMapping.ClosureTask(this); |
| 204 checker = new TypeCheckerTask(this); | 204 checker = new TypeCheckerTask(this); |
| 205 typesTask = new ti.TypesTask(this); | 205 typesTask = new ti.TypesTask(this); |
| 206 backend = emitJavaScript ? | 206 backend = emitJavaScript ? |
| 207 new js_backend.JavaScriptBackend(this, generateSourceMap) : | 207 new js_backend.JavaScriptBackend(this, generateSourceMap) : |
| 208 new dart_backend.DartBackend(this, cutDeclarationTypes); | 208 new dart_backend.DartBackend(this, forceCutDeclarationTypes); |
| 209 constantHandler = new ConstantHandler(this, backend.constantSystem); | 209 constantHandler = new ConstantHandler(this, backend.constantSystem); |
| 210 enqueuer = new EnqueueTask(this); | 210 enqueuer = new EnqueueTask(this); |
| 211 tasks = [scanner, dietParser, parser, resolver, closureToClassMapper, | 211 tasks = [scanner, dietParser, parser, resolver, closureToClassMapper, |
| 212 checker, typesTask, constantHandler, enqueuer]; | 212 checker, typesTask, constantHandler, enqueuer]; |
| 213 tasks.addAll(backend.tasks); | 213 tasks.addAll(backend.tasks); |
| 214 } | 214 } |
| 215 | 215 |
| 216 Universe get resolverWorld => enqueuer.resolution.universe; | 216 Universe get resolverWorld => enqueuer.resolution.universe; |
| 217 Universe get codegenWorld => enqueuer.codegen.universe; | 217 Universe get codegenWorld => enqueuer.codegen.universe; |
| 218 | 218 |
| (...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 943 final endOffset = end.charOffset + end.slowCharCount; | 943 final endOffset = end.charOffset + end.slowCharCount; |
| 944 | 944 |
| 945 // [begin] and [end] might be the same for the same empty token. This | 945 // [begin] and [end] might be the same for the same empty token. This |
| 946 // happens for instance when scanning '$$'. | 946 // happens for instance when scanning '$$'. |
| 947 assert(endOffset >= beginOffset); | 947 assert(endOffset >= beginOffset); |
| 948 return f(beginOffset, endOffset); | 948 return f(beginOffset, endOffset); |
| 949 } | 949 } |
| 950 | 950 |
| 951 String toString() => 'SourceSpan($uri, $begin, $end)'; | 951 String toString() => 'SourceSpan($uri, $begin, $end)'; |
| 952 } | 952 } |
| OLD | NEW |