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

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

Issue 2717673002: Use printUnexpected and add location information. (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/builder_accessors.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.source_loader; 5 library fasta.source_loader;
6 6
7 import 'dart:async' show 7 import 'dart:async' show
8 Future; 8 Future;
9 9
10 import 'dart:io' show 10 import 'dart:io' show
(...skipping 14 matching lines...) Expand all
25 import 'package:kernel/ast.dart' show 25 import 'package:kernel/ast.dart' show
26 Program; 26 Program;
27 27
28 import 'package:kernel/class_hierarchy.dart' show 28 import 'package:kernel/class_hierarchy.dart' show
29 ClassHierarchy; 29 ClassHierarchy;
30 30
31 import 'package:kernel/core_types.dart' show 31 import 'package:kernel/core_types.dart' show
32 CoreTypes; 32 CoreTypes;
33 33
34 import '../errors.dart' show 34 import '../errors.dart' show
35 InputError, 35 inputError,
36 inputError; 36 printUnexpected;
37 37
38 import '../messages.dart' show 38 import '../messages.dart' show
39 warning; 39 warning;
40 40
41 import '../export.dart' show 41 import '../export.dart' show
42 Export; 42 Export;
43 43
44 import '../analyzer/element_store.dart' show 44 import '../analyzer/element_store.dart' show
45 ElementStore; 45 ElementStore;
46 46
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 List<int> bytes = await readBytesFromFile(uri); 91 List<int> bytes = await readBytesFromFile(uri);
92 byteCount += bytes.length - 1; 92 byteCount += bytes.length - 1;
93 ScannerResult result = scan(bytes); 93 ScannerResult result = scan(bytes);
94 Token token = result.tokens; 94 Token token = result.tokens;
95 if (!suppressLexicalErrors) { 95 if (!suppressLexicalErrors) {
96 target.addLineStarts(library.fileUri, result.lineStarts); 96 target.addLineStarts(library.fileUri, result.lineStarts);
97 } 97 }
98 while (token is ErrorToken) { 98 while (token is ErrorToken) {
99 if (!suppressLexicalErrors) { 99 if (!suppressLexicalErrors) {
100 ErrorToken error = token; 100 ErrorToken error = token;
101 print(new InputError(uri, token.charOffset, error.assertionMessage) 101 printUnexpected(uri, token.charOffset, error.assertionMessage);
102 .format());
103 } 102 }
104 token = token.next; 103 token = token.next;
105 } 104 }
106 return token; 105 return token;
107 } on FileSystemException catch (e) { 106 } on FileSystemException catch (e) {
108 String message = e.message; 107 String message = e.message;
109 String osMessage = e.osError?.message; 108 String osMessage = e.osError?.message;
110 if (osMessage != null && osMessage.isNotEmpty) { 109 if (osMessage != null && osMessage.isNotEmpty) {
111 message = osMessage; 110 message = osMessage;
112 } 111 }
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 ticker.logMs("Built analyzer element model."); 363 ticker.logMs("Built analyzer element model.");
365 } 364 }
366 365
367 void computeHierarchy(Program program) { 366 void computeHierarchy(Program program) {
368 hierarchy = new ClassHierarchy(program); 367 hierarchy = new ClassHierarchy(program);
369 ticker.logMs("Computed class hierarchy"); 368 ticker.logMs("Computed class hierarchy");
370 coreTypes = new CoreTypes(program); 369 coreTypes = new CoreTypes(program);
371 ticker.logMs("Computed core types"); 370 ticker.logMs("Computed core types");
372 } 371 }
373 } 372 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/builder_accessors.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698