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

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

Issue 2915123002: Improve position information. (Closed)
Patch Set: 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.outline_builder; 5 library fasta.outline_builder;
6 6
7 import 'package:kernel/ast.dart' show ProcedureKind; 7 import 'package:kernel/ast.dart' show ProcedureKind;
8 8
9 import '../fasta_codes.dart' show FastaMessage, codeExpectedBlockToSkip; 9 import '../fasta_codes.dart' show FastaMessage, codeExpectedBlockToSkip;
10 10
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 @override 152 @override
153 void handleRecoverExpression(Token token) { 153 void handleRecoverExpression(Token token) {
154 debugEvent("RecoverExpression"); 154 debugEvent("RecoverExpression");
155 push(NullValue.Expression); 155 push(NullValue.Expression);
156 push(token.charOffset); 156 push(token.charOffset);
157 } 157 }
158 158
159 @override 159 @override
160 void endPart(Token partKeyword, Token semicolon) { 160 void endPart(Token partKeyword, Token semicolon) {
161 debugEvent("Part"); 161 debugEvent("Part");
162 popCharOffset(); 162 int charOffset = popCharOffset();
163 String uri = pop(); 163 String uri = pop();
164 List<MetadataBuilder> metadata = pop(); 164 List<MetadataBuilder> metadata = pop();
165 if (uri != null) { 165 if (uri != null) {
166 library.addPart(metadata, uri); 166 library.addPart(metadata, uri, charOffset);
167 } 167 }
168 checkEmpty(partKeyword.charOffset); 168 checkEmpty(partKeyword.charOffset);
169 } 169 }
170 170
171 @override 171 @override
172 void handleOperatorName(Token operatorKeyword, Token token) { 172 void handleOperatorName(Token operatorKeyword, Token token) {
173 debugEvent("OperatorName"); 173 debugEvent("OperatorName");
174 push(operatorFromString(token.stringValue)); 174 push(operatorFromString(token.stringValue));
175 push(token.charOffset); 175 push(token.charOffset);
176 } 176 }
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 nativeMethodName, 388 nativeMethodName,
389 isTopLevel: false); 389 isTopLevel: false);
390 nativeMethodName = null; 390 nativeMethodName = null;
391 } 391 }
392 392
393 @override 393 @override
394 void endMixinApplication(Token withKeyword) { 394 void endMixinApplication(Token withKeyword) {
395 debugEvent("MixinApplication"); 395 debugEvent("MixinApplication");
396 List<TypeBuilder> mixins = pop(); 396 List<TypeBuilder> mixins = pop();
397 TypeBuilder supertype = pop(); 397 TypeBuilder supertype = pop();
398 push(library.addMixinApplication(supertype, mixins, -1)); 398 push(
399 library.addMixinApplication(supertype, mixins, withKeyword.charOffset));
399 } 400 }
400 401
401 @override 402 @override
402 void beginNamedMixinApplication(Token begin, Token name) { 403 void beginNamedMixinApplication(Token begin, Token name) {
403 library.beginNestedDeclaration(name.lexeme, hasMembers: false); 404 library.beginNestedDeclaration(name.lexeme, hasMembers: false);
404 } 405 }
405 406
406 @override 407 @override
407 void endNamedMixinApplication(Token beginToken, Token classKeyword, 408 void endNamedMixinApplication(Token beginToken, Token classKeyword,
408 Token equals, Token implementsKeyword, Token endToken) { 409 Token equals, Token implementsKeyword, Token endToken) {
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 Link<Token> handleMemberName(Link<Token> identifiers) { 798 Link<Token> handleMemberName(Link<Token> identifiers) {
798 if (!enableNative || identifiers.isEmpty) return identifiers; 799 if (!enableNative || identifiers.isEmpty) return identifiers;
799 return removeNativeClause(identifiers); 800 return removeNativeClause(identifiers);
800 } 801 }
801 802
802 @override 803 @override
803 void debugEvent(String name) { 804 void debugEvent(String name) {
804 // printEvent(name); 805 // printEvent(name);
805 } 806 }
806 } 807 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/quote.dart ('k') | pkg/front_end/lib/src/fasta/source/source_library_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698