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

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

Issue 2747173002: Handle 'part of' declarations with URI correctly in Fasta. (Closed)
Patch Set: dartfmt. 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
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 AsyncMarker, ProcedureKind; 7 import 'package:kernel/ast.dart' show AsyncMarker, ProcedureKind;
8 8
9 import '../parser/parser.dart' show FormalParameterType, optional; 9 import '../parser/parser.dart' show FormalParameterType, optional;
10 10
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 569
570 @override 570 @override
571 void endTypeVariable(Token token, Token extendsOrSuper) { 571 void endTypeVariable(Token token, Token extendsOrSuper) {
572 debugEvent("endTypeVariable"); 572 debugEvent("endTypeVariable");
573 TypeBuilder bound = pop(); 573 TypeBuilder bound = pop();
574 String name = pop(); 574 String name = pop();
575 push(library.addTypeVariable(name, bound, token.charOffset)); 575 push(library.addTypeVariable(name, bound, token.charOffset));
576 } 576 }
577 577
578 @override 578 @override
579 void endPartOf(Token partKeyword, Token semicolon) { 579 void endPartOf(Token partKeyword, Token semicolon, bool hasName) {
580 debugEvent("endPartOf"); 580 debugEvent("endPartOf");
581 String name = pop(); 581 String name = hasName ? pop() : null;
Paul Berry 2017/03/14 14:48:23 I see what you're doing here, but IMHO it's a litt
ahe 2017/03/15 14:05:36 Honestly, I wasn't super happy with it either :-)
582 String uri = hasName ? null : pop();
582 List<MetadataBuilder> metadata = pop(); 583 List<MetadataBuilder> metadata = pop();
583 library.addPartOf(metadata, name); 584 library.addPartOf(metadata, name, uri);
584 } 585 }
585 586
586 @override 587 @override
587 void endConstructorReference( 588 void endConstructorReference(
588 Token start, Token periodBeforeName, Token endToken) { 589 Token start, Token periodBeforeName, Token endToken) {
589 debugEvent("ConstructorReference"); 590 debugEvent("ConstructorReference");
590 String suffix = popIfNotNull(periodBeforeName); 591 String suffix = popIfNotNull(periodBeforeName);
591 List<TypeBuilder> typeArguments = pop(); 592 List<TypeBuilder> typeArguments = pop();
592 String name = pop(); 593 String name = pop();
593 push(library.addConstructorReference( 594 push(library.addConstructorReference(
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 Link<Token> handleMemberName(Link<Token> identifiers) { 701 Link<Token> handleMemberName(Link<Token> identifiers) {
701 if (!isDartLibrary || identifiers.isEmpty) return identifiers; 702 if (!isDartLibrary || identifiers.isEmpty) return identifiers;
702 return removeNativeClause(identifiers); 703 return removeNativeClause(identifiers);
703 } 704 }
704 705
705 @override 706 @override
706 void debugEvent(String name) { 707 void debugEvent(String name) {
707 // printEvent(name); 708 // printEvent(name);
708 } 709 }
709 } 710 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/source/diet_listener.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