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

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

Issue 2828253003: Add top level type inference logic for integer literals. (Closed)
Patch Set: Clean up, bug fix, and remove unintentional expectations changes Created 3 years, 8 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 '../fasta_codes.dart' show FastaMessage, codeExpectedBlockToSkip; 9 import '../fasta_codes.dart' show FastaMessage, codeExpectedBlockToSkip;
10 10
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 } 646 }
647 List<MetadataBuilder> metadata = pop(); 647 List<MetadataBuilder> metadata = pop();
648 library.addFunctionTypeAlias( 648 library.addFunctionTypeAlias(
649 metadata, returnType, name, typeVariables, formals, charOffset); 649 metadata, returnType, name, typeVariables, formals, charOffset);
650 checkEmpty(typedefKeyword.charOffset); 650 checkEmpty(typedefKeyword.charOffset);
651 } 651 }
652 652
653 @override 653 @override
654 void endTopLevelFields(int count, Token beginToken, Token endToken) { 654 void endTopLevelFields(int count, Token beginToken, Token endToken) {
655 debugEvent("endTopLevelFields"); 655 debugEvent("endTopLevelFields");
656 List namesAndOffsets = popList(count * 2); 656 List namesOffsetsAndInitializers = popList(count * 4);
657 TypeBuilder type = pop(); 657 TypeBuilder type = pop();
658 int modifiers = Modifier.validate(pop()); 658 int modifiers = Modifier.validate(pop());
659 List<MetadataBuilder> metadata = pop(); 659 List<MetadataBuilder> metadata = pop();
660 library.addFields(metadata, modifiers, type, namesAndOffsets); 660 library.addFields(metadata, modifiers, type, namesOffsetsAndInitializers);
661 checkEmpty(beginToken.charOffset); 661 checkEmpty(beginToken.charOffset);
662 } 662 }
663 663
664 @override 664 @override
665 void endFields( 665 void endFields(
666 int count, Token covariantToken, Token beginToken, Token endToken) { 666 int count, Token covariantToken, Token beginToken, Token endToken) {
667 debugEvent("Fields"); 667 debugEvent("Fields");
668 List namesAndOffsets = popList(count * 2); 668 List namesOffsetsAndInitializers = popList(count * 4);
669 TypeBuilder type = pop(); 669 TypeBuilder type = pop();
670 int modifiers = Modifier.validate(pop()); 670 int modifiers = Modifier.validate(pop());
671 List<MetadataBuilder> metadata = pop(); 671 List<MetadataBuilder> metadata = pop();
672 library.addFields(metadata, modifiers, type, namesAndOffsets); 672 library.addFields(metadata, modifiers, type, namesOffsetsAndInitializers);
673 } 673 }
674 674
675 @override 675 @override
676 void endTypeVariable(Token token, Token extendsOrSuper) { 676 void endTypeVariable(Token token, Token extendsOrSuper) {
677 debugEvent("endTypeVariable"); 677 debugEvent("endTypeVariable");
678 TypeBuilder bound = pop(); 678 TypeBuilder bound = pop();
679 int charOffset = pop(); 679 int charOffset = pop();
680 String name = pop(); 680 String name = pop();
681 // TODO(paulberry): type variable metadata should not be ignored. See 681 // TODO(paulberry): type variable metadata should not be ignored. See
682 // dartbug.com/28981. 682 // dartbug.com/28981.
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 nativeMethodName = null; 744 nativeMethodName = null;
745 } 745 }
746 746
747 @override 747 @override
748 void endRedirectingFactoryBody(Token beginToken, Token endToken) { 748 void endRedirectingFactoryBody(Token beginToken, Token endToken) {
749 debugEvent("RedirectingFactoryBody"); 749 debugEvent("RedirectingFactoryBody");
750 push(MethodBody.RedirectingFactoryBody); 750 push(MethodBody.RedirectingFactoryBody);
751 } 751 }
752 752
753 @override 753 @override
754 void endFieldInitializer(Token assignmentOperator) { 754 void endFieldInitializer(Token assignmentOperator, Token token) {
755 debugEvent("FieldInitializer"); 755 debugEvent("FieldInitializer");
756 // Ignoring field initializers for now. 756 push(assignmentOperator.next);
757 push(token);
757 } 758 }
758 759
759 @override 760 @override
760 void handleNoFieldInitializer(Token token) { 761 void handleNoFieldInitializer(Token token) {
761 debugEvent("NoFieldInitializer"); 762 debugEvent("NoFieldInitializer");
763 push(NullValue.FieldInitializer);
764 push(NullValue.FieldInitializer);
762 } 765 }
763 766
764 @override 767 @override
765 void endInitializers(int count, Token beginToken, Token endToken) { 768 void endInitializers(int count, Token beginToken, Token endToken) {
766 debugEvent("Initializers"); 769 debugEvent("Initializers");
767 // Ignored for now. 770 // Ignored for now.
768 } 771 }
769 772
770 @override 773 @override
771 void handleNoInitializers() { 774 void handleNoInitializers() {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 Link<Token> handleMemberName(Link<Token> identifiers) { 821 Link<Token> handleMemberName(Link<Token> identifiers) {
819 if (!isDartLibrary || identifiers.isEmpty) return identifiers; 822 if (!isDartLibrary || identifiers.isEmpty) return identifiers;
820 return removeNativeClause(identifiers); 823 return removeNativeClause(identifiers);
821 } 824 }
822 825
823 @override 826 @override
824 void debugEvent(String name) { 827 void debugEvent(String name) {
825 // printEvent(name); 828 // printEvent(name);
826 } 829 }
827 } 830 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698