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

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

Issue 2951453002: [kernel] Make fasta call a new constructor on FallThroughError (Closed)
Patch Set: Addressed comments Created 3 years, 6 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) 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 file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library fasta.messages; 5 library fasta.messages;
6 6
7 import 'package:kernel/ast.dart' show Location; 7 import 'package:kernel/ast.dart' show Location;
8 8
9 import 'util/relativize.dart' show relativizeUri; 9 import 'util/relativize.dart' show relativizeUri;
10 10
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } else { 74 } else {
75 return message; 75 return message;
76 } 76 }
77 } 77 }
78 78
79 Location getLocation(String path, int charOffset) { 79 Location getLocation(String path, int charOffset) {
80 return CompilerContext.current.uriToSource[path] 80 return CompilerContext.current.uriToSource[path]
81 ?.getLocation(path, charOffset); 81 ?.getLocation(path, charOffset);
82 } 82 }
83 83
84 Location getLocationFromUri(Uri uri, int charOffset) {
85 if (charOffset == -1) return null;
86 String path = relativizeUri(uri);
87 return getLocation(path, charOffset);
88 }
89
84 String getSourceLine(Location location) { 90 String getSourceLine(Location location) {
85 if (location == null) return null; 91 if (location == null) return null;
86 return CompilerContext.current.uriToSource[location.file] 92 return CompilerContext.current.uriToSource[location.file]
87 ?.getTextLine(location.line); 93 ?.getTextLine(location.line);
88 } 94 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/loader.dart ('k') | pkg/front_end/lib/src/fasta/target_implementation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698