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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 p = await sourceTarget.buildProgram(); | 260 p = await sourceTarget.buildProgram(); |
260 instrumentation?.finish(); | 261 instrumentation?.finish(); |
261 if (instrumentation != null && instrumentation.hasProblems) { | 262 if (instrumentation != null && instrumentation.hasProblems) { |
262 if (updateComments) { | 263 if (updateComments) { |
263 await instrumentation.fixSource(description.uri, false); | 264 await instrumentation.fixSource(description.uri, false); |
264 } else { | 265 } else { |
265 return fail(null, instrumentation.problemsAsString); | 266 return fail(null, instrumentation.problemsAsString); |
266 } | 267 } |
267 } | 268 } |
268 } | 269 } |
269 } on InputError catch (e, s) { | 270 } on deprecated_InputError catch (e, s) { |
270 return fail(null, e.error, s); | 271 return fail(null, e.error, s); |
271 } | 272 } |
272 context.programToTarget.clear(); | 273 context.programToTarget.clear(); |
273 context.programToTarget[p] = sourceTarget; | 274 context.programToTarget[p] = sourceTarget; |
274 return pass(p); | 275 return pass(p); |
275 } | 276 } |
276 } | 277 } |
277 | 278 |
278 class Transform extends Step<Program, Program, FastaContext> { | 279 class Transform extends Step<Program, Program, FastaContext> { |
279 const Transform(); | 280 const Transform(); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 } | 314 } |
314 } | 315 } |
315 | 316 |
316 void performGlobalTransformations(CoreTypes coreTypes, Program program, | 317 void performGlobalTransformations(CoreTypes coreTypes, Program program, |
317 {void logger(String msg)}) { | 318 {void logger(String msg)}) { |
318 if (enabled) { | 319 if (enabled) { |
319 super.performGlobalTransformations(coreTypes, program, logger: logger); | 320 super.performGlobalTransformations(coreTypes, program, logger: logger); |
320 } | 321 } |
321 } | 322 } |
322 } | 323 } |
OLD | NEW |