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

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

Issue 2704753002: Implement line and column numbers. (Closed)
Patch Set: Undo whitespace change. Created 3 years, 10 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.builder; 5 library fasta.builder;
6 6
7 import '../errors.dart' show 7 import '../errors.dart' show
8 internalError; 8 internalError;
9 9
10 import '../messages.dart' show
11 nit;
12
10 export 'class_builder.dart' show 13 export 'class_builder.dart' show
11 ClassBuilder; 14 ClassBuilder;
12 15
13 export 'field_builder.dart' show 16 export 'field_builder.dart' show
14 FieldBuilder; 17 FieldBuilder;
15 18
16 export 'library_builder.dart' show 19 export 'library_builder.dart' show
17 LibraryBuilder; 20 LibraryBuilder;
18 21
19 export 'procedure_builder.dart' show 22 export 'procedure_builder.dart' show
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 hidden = other; 123 hidden = other;
121 } else if (getUri(other)?.scheme == "dart" && 124 } else if (getUri(other)?.scheme == "dart" &&
122 getUri(this)?.scheme != "dart") { 125 getUri(this)?.scheme != "dart") {
123 preferred = this; 126 preferred = this;
124 hidden = other; 127 hidden = other;
125 } else if (getUri(this)?.scheme == "dart" && 128 } else if (getUri(this)?.scheme == "dart" &&
126 getUri(other)?.scheme != "dart") { 129 getUri(other)?.scheme != "dart") {
127 preferred = other; 130 preferred = other;
128 hidden = this; 131 hidden = this;
129 } else { 132 } else {
130 print("${library.uri}: Note: '$name' is imported from both " 133 nit(library.fileUri, -1, "'$name' is imported from both "
karlklose 2017/02/20 08:06:19 Consider defining a constant (like NO_COLUMN_INFOR
ahe 2017/02/20 08:47:02 Normally, I do prefer naming constants, but it fee
131 "'${getUri(this)}' and '${getUri(other)}'."); 134 "'${getUri(this)}' and '${getUri(other)}'.");
132 return library.buildAmbiguousBuilder(name, this, other, charOffset); 135 return library.buildAmbiguousBuilder(name, this, other, charOffset);
133 } 136 }
134 if (isLocal) { 137 if (isLocal) {
135 print("${library.uri}: Note: local definition of '$name' hides imported " 138 nit(library.fileUri, -1, "Local definition of '$name' hides imported "
136 "version from '${getUri(other)}'."); 139 "version from '${getUri(other)}'.");
137 } else { 140 } else {
138 print("${library.uri}: import of '$name' (from '${getUri(preferred)}') " 141 nit(library.fileUri, -1, "Import of '$name' "
139 "hides imported version from '${getUri(hidden)}'."); 142 "(from '${getUri(preferred)}') hides imported version from "
143 "'${getUri(hidden)}'.");
140 } 144 }
141 return preferred; 145 return preferred;
142 } 146 }
143 147
144 Builder get parent => null; 148 Builder get parent => null;
145 149
146 bool get isFinal => false; 150 bool get isFinal => false;
147 151
148 bool get isField => false; 152 bool get isField => false;
149 153
(...skipping 23 matching lines...) Expand all
173 177
174 static Uri getUri(Builder builder) { 178 static Uri getUri(Builder builder) {
175 if (builder == null) return internalError("Builder is null."); 179 if (builder == null) return internalError("Builder is null.");
176 while (builder != null) { 180 while (builder != null) {
177 if (builder is LibraryBuilder) return builder.uri; 181 if (builder is LibraryBuilder) return builder.uri;
178 builder = builder.parent; 182 builder = builder.parent;
179 } 183 }
180 return internalError("No library parent."); 184 return internalError("No library parent.");
181 } 185 }
182 } 186 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698