OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 input.transformer.instrumentation; | 5 library input.transformer.instrumentation; |
6 | 6 |
7 import 'dart:convert'; | 7 import 'dart:convert'; |
8 | 8 |
9 import 'package:analyzer/src/generated/java_engine.dart'; | 9 import 'package:analyzer/src/generated/java_engine.dart'; |
10 import 'package:analyzer/instrumentation/instrumentation.dart'; | 10 import 'package:analyzer/instrumentation/instrumentation.dart'; |
(...skipping 11 matching lines...) Expand all Loading... |
22 class InstrumentationInputConverter extends CommonInputConverter { | 22 class InstrumentationInputConverter extends CommonInputConverter { |
23 final Set<String> codesSeen = new Set<String>(); | 23 final Set<String> codesSeen = new Set<String>(); |
24 | 24 |
25 /** | 25 /** |
26 * [readBuffer] holds the contents of the file being read from disk | 26 * [readBuffer] holds the contents of the file being read from disk |
27 * as recorded in the instrumentation log | 27 * as recorded in the instrumentation log |
28 * or `null` if not converting a "Read" entry. | 28 * or `null` if not converting a "Read" entry. |
29 */ | 29 */ |
30 StringBuffer readBuffer = null; | 30 StringBuffer readBuffer = null; |
31 | 31 |
32 InstrumentationInputConverter(Map<String, String> srcPathMap) | 32 InstrumentationInputConverter( |
33 : super(srcPathMap); | 33 String tmpSrcDirPath, Map<String, String> srcPathMap) |
| 34 : super(tmpSrcDirPath, srcPathMap); |
34 | 35 |
35 @override | 36 @override |
36 Operation convert(String line) { | 37 Operation convert(String line) { |
37 List<String> fields; | 38 List<String> fields; |
38 try { | 39 try { |
39 fields = _parseFields(line); | 40 fields = _parseFields(line); |
40 if (fields.length < 2) { | 41 if (fields.length < 2) { |
41 if (readBuffer != null) { | 42 if (readBuffer != null) { |
42 readBuffer.writeln(fields.length == 1 ? fields[0] : ''); | 43 readBuffer.writeln(fields.length == 1 ? fields[0] : ''); |
43 return null; | 44 return null; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 sb.writeCharCode(code); | 141 sb.writeCharCode(code); |
141 } | 142 } |
142 ++index; | 143 ++index; |
143 } | 144 } |
144 if (sb.isNotEmpty) { | 145 if (sb.isNotEmpty) { |
145 fields.add(sb.toString()); | 146 fields.add(sb.toString()); |
146 } | 147 } |
147 return fields; | 148 return fields; |
148 } | 149 } |
149 } | 150 } |
OLD | NEW |