Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: pkg/front_end/lib/src/fasta/testing/validating_instrumentation.dart

Issue 2970273004: Deprecate all diagnostics methods that use strings. (Closed)
Patch Set: Merged with 4df146dd9a465d63344330bf3e45524b927c92ec Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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';
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 String _escape(String s) { 193 String _escape(String s) {
194 s = s.replaceAll(r'\', r'\\'); 194 s = s.replaceAll(r'\', r'\\');
195 if (s.endsWith('/')) { 195 if (s.endsWith('/')) {
196 s = '$s '; 196 s = '$s ';
197 } 197 }
198 return s.replaceAll('/*', r'/\*').replaceAll('*/', r'*\/'); 198 return s.replaceAll('/*', r'/\*').replaceAll('*/', r'*\/');
199 } 199 }
200 200
201 String _formatProblem( 201 String _formatProblem(
202 Uri uri, int offset, String desc, StackTrace stackTrace) { 202 Uri uri, int offset, String desc, StackTrace stackTrace) {
203 return format( 203 return deprecated_format(
204 uri, offset, '$desc${stackTrace == null ? '' : '\n$stackTrace'}'); 204 uri, offset, '$desc${stackTrace == null ? '' : '\n$stackTrace'}');
205 } 205 }
206 206
207 String _makeExpectationComment(String property, InstrumentationValue value) { 207 String _makeExpectationComment(String property, InstrumentationValue value) {
208 return '/*@$property=${_escape(value.toString())}*/'; 208 return '/*@$property=${_escape(value.toString())}*/';
209 } 209 }
210 210
211 void _problem(Uri uri, int offset, String desc, _Fix fix) { 211 void _problem(Uri uri, int offset, String desc, _Fix fix) {
212 _problems.add(_formatProblem(uri, offset, desc, null)); 212 _problems.add(_formatProblem(uri, offset, desc, null));
213 _fixes.putIfAbsent(uri, () => []).add(fix); 213 _fixes.putIfAbsent(uri, () => []).add(fix);
(...skipping 27 matching lines...) Expand all
241 this.property, this.value, this.commentOffset, this.commentLength); 241 this.property, this.value, this.commentOffset, this.commentLength);
242 } 242 }
243 243
244 class _Fix { 244 class _Fix {
245 final int offset; 245 final int offset;
246 final int length; 246 final int length;
247 final String replacement; 247 final String replacement;
248 248
249 _Fix(this.offset, this.length, this.replacement); 249 _Fix(this.offset, this.length, this.replacement);
250 } 250 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/testing/environment_variable.dart ('k') | pkg/front_end/lib/src/fasta/translate_uri.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698