| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'dart:async'; | 4 import 'dart:async'; |
| 5 import 'dart:convert'; | 5 import 'dart:convert'; |
| 6 import 'dart:io'; | 6 import 'dart:io'; |
| 7 | 7 |
| 8 import 'package:front_end/src/base/instrumentation.dart'; | 8 import 'package:front_end/src/base/instrumentation.dart'; |
| 9 import 'package:front_end/src/fasta/messages.dart'; | 9 import 'package:front_end/src/fasta/messages.dart'; |
| 10 import 'package:front_end/src/fasta/scanner.dart'; | 10 import 'package:front_end/src/fasta/scanner.dart'; |
| 11 import 'package:front_end/src/fasta/scanner/io.dart'; | 11 import 'package:front_end/src/fasta/scanner/io.dart'; |
| 12 | 12 |
| 13 /// Implementation of [Instrumentation] which checks property/value pairs | 13 /// Implementation of [Instrumentation] which checks property/value pairs |
| 14 /// against expectations encoded in source files using "/*@...*/" comments. | 14 /// against expectations encoded in source files using "/*@...*/" comments. |
| 15 class ValidatingInstrumentation implements Instrumentation { | 15 class ValidatingInstrumentation implements Instrumentation { |
| 16 static final _ESCAPE_SEQUENCE = new RegExp(r'\\(.)'); | 16 static final _ESCAPE_SEQUENCE = new RegExp(r'\\(.)'); |
| 17 | 17 |
| 18 /// Map from feature names to the property names they are short for. | 18 /// Map from feature names to the property names they are short for. |
| 19 static const _FEATURES = const { | 19 static const _FEATURES = const { |
| 20 'inference': const [ | 20 'inference': const [ |
| 21 'topType', | 21 'topType', |
| 22 'typeArg', | 22 'typeArg', |
| 23 'typeArgs', |
| 23 'promotedType', | 24 'promotedType', |
| 24 'type', | 25 'type', |
| 25 'returnType' | 26 'returnType' |
| 26 ], | 27 ], |
| 27 }; | 28 }; |
| 28 | 29 |
| 29 /// Map from file URI to the as-yet unsatisfied expectations from that file, | 30 /// Map from file URI to the as-yet unsatisfied expectations from that file, |
| 30 /// organized by file offset. | 31 /// organized by file offset. |
| 31 final _unsatisfiedExpectations = <Uri, Map<int, List<_Expectation>>>{}; | 32 final _unsatisfiedExpectations = <Uri, Map<int, List<_Expectation>>>{}; |
| 32 | 33 |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 this.property, this.value, this.commentOffset, this.commentLength); | 221 this.property, this.value, this.commentOffset, this.commentLength); |
| 221 } | 222 } |
| 222 | 223 |
| 223 class _Fix { | 224 class _Fix { |
| 224 final int offset; | 225 final int offset; |
| 225 final int length; | 226 final int length; |
| 226 final String replacement; | 227 final String replacement; |
| 227 | 228 |
| 228 _Fix(this.offset, this.length, this.replacement); | 229 _Fix(this.offset, this.length, this.replacement); |
| 229 } | 230 } |
| OLD | NEW |