OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 library fasta.testing.suite; | 5 library fasta.testing.suite; |
6 | 6 |
7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
8 | 8 |
9 import 'dart:io' show File; | 9 import 'dart:io' show File; |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 Chain, | 25 Chain, |
26 ChainContext, | 26 ChainContext, |
27 ExpectationSet, | 27 ExpectationSet, |
28 Result, | 28 Result, |
29 Step, | 29 Step, |
30 TestDescription, | 30 TestDescription, |
31 StdioProcess; | 31 StdioProcess; |
32 | 32 |
33 import 'package:front_end/src/fasta/compiler_context.dart' show CompilerContext; | 33 import 'package:front_end/src/fasta/compiler_context.dart' show CompilerContext; |
34 | 34 |
35 import 'package:front_end/src/fasta/errors.dart' show InputError; | 35 import 'package:front_end/src/fasta/deprecated_problems.dart' |
| 36 show deprecated_InputError; |
36 | 37 |
37 import 'package:front_end/src/fasta/testing/kernel_chain.dart' | 38 import 'package:front_end/src/fasta/testing/kernel_chain.dart' |
38 show MatchExpectation, Print, Verify, WriteDill; | 39 show MatchExpectation, Print, Verify, WriteDill; |
39 | 40 |
40 import 'package:front_end/src/fasta/ticker.dart' show Ticker; | 41 import 'package:front_end/src/fasta/ticker.dart' show Ticker; |
41 | 42 |
42 import 'package:front_end/src/fasta/translate_uri.dart' show TranslateUri; | 43 import 'package:front_end/src/fasta/translate_uri.dart' show TranslateUri; |
43 | 44 |
44 import 'package:analyzer/src/fasta/analyzer_target.dart' show AnalyzerTarget; | 45 import 'package:analyzer/src/fasta/analyzer_target.dart' show AnalyzerTarget; |
45 | 46 |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 p = await sourceTarget.buildProgram(trimDependencies: true); | 263 p = await sourceTarget.buildProgram(trimDependencies: true); |
263 instrumentation?.finish(); | 264 instrumentation?.finish(); |
264 if (instrumentation != null && instrumentation.hasProblems) { | 265 if (instrumentation != null && instrumentation.hasProblems) { |
265 if (updateComments) { | 266 if (updateComments) { |
266 await instrumentation.fixSource(description.uri, false); | 267 await instrumentation.fixSource(description.uri, false); |
267 } else { | 268 } else { |
268 return fail(null, instrumentation.problemsAsString); | 269 return fail(null, instrumentation.problemsAsString); |
269 } | 270 } |
270 } | 271 } |
271 } | 272 } |
272 } on InputError catch (e, s) { | 273 } on deprecated_InputError catch (e, s) { |
273 return fail(null, e.error, s); | 274 return fail(null, e.error, s); |
274 } | 275 } |
275 context.programToTarget.clear(); | 276 context.programToTarget.clear(); |
276 context.programToTarget[p] = sourceTarget; | 277 context.programToTarget[p] = sourceTarget; |
277 return pass(p); | 278 return pass(p); |
278 } | 279 } |
279 } | 280 } |
280 | 281 |
281 class Transform extends Step<Program, Program, FastaContext> { | 282 class Transform extends Step<Program, Program, FastaContext> { |
282 const Transform(); | 283 const Transform(); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 } | 317 } |
317 } | 318 } |
318 | 319 |
319 void performGlobalTransformations(CoreTypes coreTypes, Program program, | 320 void performGlobalTransformations(CoreTypes coreTypes, Program program, |
320 {void logger(String msg)}) { | 321 {void logger(String msg)}) { |
321 if (enabled) { | 322 if (enabled) { |
322 super.performGlobalTransformations(coreTypes, program, logger: logger); | 323 super.performGlobalTransformations(coreTypes, program, logger: logger); |
323 } | 324 } |
324 } | 325 } |
325 } | 326 } |
OLD | NEW |