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

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

Issue 2778213002: Use message.yaml in parser. (Closed)
Patch Set: Update subpackage relationships. 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;
10
9 import '../parser/parser.dart' show FormalParameterType, optional; 11 import '../parser/parser.dart' show FormalParameterType, optional;
10 12
11 import '../parser/identifier_context.dart' show IdentifierContext; 13 import '../parser/identifier_context.dart' show IdentifierContext;
12 14
13 import '../scanner/token.dart' show Token; 15 import '../scanner/token.dart' show Token;
14 16
15 import '../util/link.dart' show Link; 17 import '../util/link.dart' show Link;
16 18
17 import '../combinator.dart' show Combinator; 19 import '../combinator.dart' show Combinator;
18 20
19 import '../errors.dart' show internalError; 21 import '../errors.dart' show internalError;
20 22
21 import '../builder/builder.dart'; 23 import '../builder/builder.dart';
22 24
23 import '../modifier.dart' show Modifier; 25 import '../modifier.dart' show Modifier;
24 26
25 import 'source_library_builder.dart' show SourceLibraryBuilder; 27 import 'source_library_builder.dart' show SourceLibraryBuilder;
26 28
27 import 'unhandled_listener.dart' show NullValue, Unhandled, UnhandledListener; 29 import 'unhandled_listener.dart' show NullValue, Unhandled, UnhandledListener;
28 30
29 import '../parser/error_kind.dart' show ErrorKind;
30
31 import '../parser/dart_vm_native.dart' 31 import '../parser/dart_vm_native.dart'
32 show removeNativeClause, skipNativeClause; 32 show removeNativeClause, skipNativeClause;
33 33
34 import '../operator.dart' show Operator, operatorFromString, operatorToString; 34 import '../operator.dart' show Operator, operatorFromString, operatorToString;
35 35
36 import '../quote.dart' show unescapeString; 36 import '../quote.dart' show unescapeString;
37 37
38 enum MethodBody { 38 enum MethodBody {
39 Abstract, 39 Abstract,
40 Regular, 40 Regular,
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 push(new Modifier.fromString(token.stringValue)); 775 push(new Modifier.fromString(token.stringValue));
776 } 776 }
777 777
778 @override 778 @override
779 void handleModifiers(int count) { 779 void handleModifiers(int count) {
780 debugEvent("Modifiers"); 780 debugEvent("Modifiers");
781 push(popList(count) ?? NullValue.Modifiers); 781 push(popList(count) ?? NullValue.Modifiers);
782 } 782 }
783 783
784 @override 784 @override
785 Token handleUnrecoverableError(Token token, ErrorKind kind, Map arguments) { 785 Token handleUnrecoverableError(Token token, FastaMessage message) {
786 if (isDartLibrary && kind == ErrorKind.ExpectedBlockToSkip) { 786 if (isDartLibrary && message.code == codeExpectedBlockToSkip) {
787 Token recover = skipNativeClause(token); 787 Token recover = skipNativeClause(token);
788 if (recover != null) { 788 if (recover != null) {
789 nativeMethodName = unescapeString(token.next.lexeme); 789 nativeMethodName = unescapeString(token.next.lexeme);
790 return recover; 790 return recover;
791 } 791 }
792 } 792 }
793 return super.handleUnrecoverableError(token, kind, arguments); 793 return super.handleUnrecoverableError(token, message);
794 } 794 }
795 795
796 @override 796 @override
797 Link<Token> handleMemberName(Link<Token> identifiers) { 797 Link<Token> handleMemberName(Link<Token> identifiers) {
798 if (!isDartLibrary || identifiers.isEmpty) return identifiers; 798 if (!isDartLibrary || identifiers.isEmpty) return identifiers;
799 return removeNativeClause(identifiers); 799 return removeNativeClause(identifiers);
800 } 800 }
801 801
802 @override 802 @override
803 void debugEvent(String name) { 803 void debugEvent(String name) {
804 // printEvent(name); 804 // printEvent(name);
805 } 805 }
806 } 806 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/source/diet_parser.dart ('k') | pkg/front_end/lib/src/fasta/source/stack_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698