OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 dart2js.parser.node_listener; | 5 library dart2js.parser.node_listener; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../elements/elements.dart' show CompilationUnitElement; | 8 import '../elements/elements.dart' show CompilationUnitElement; |
9 import 'package:front_end/src/fasta/parser/parser.dart' | 9 import 'package:front_end/src/fasta/parser/parser.dart' |
10 show FormalParameterType; | 10 show FormalParameterType; |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 void endMember() { | 657 void endMember() { |
658 // TODO(sigmund): consider moving metadata into each declaration | 658 // TODO(sigmund): consider moving metadata into each declaration |
659 // element instead. | 659 // element instead. |
660 Node node = popNode(); // member | 660 Node node = popNode(); // member |
661 popNode(); // Discard metadata | 661 popNode(); // Discard metadata |
662 pushNode(node); | 662 pushNode(node); |
663 super.endMember(); | 663 super.endMember(); |
664 } | 664 } |
665 | 665 |
666 @override | 666 @override |
667 void endFields(int count, Token beginToken, Token endToken) { | 667 void endFields( |
| 668 int count, Token covariantKeyword, Token beginToken, Token endToken) { |
668 NodeList variables = makeNodeList(count, null, endToken, ","); | 669 NodeList variables = makeNodeList(count, null, endToken, ","); |
669 TypeAnnotation type = popNode(); | 670 TypeAnnotation type = popNode(); |
670 Modifiers modifiers = popNode(); | 671 Modifiers modifiers = popNode(); |
671 pushNode(new VariableDefinitions(type, modifiers, variables)); | 672 pushNode(new VariableDefinitions(type, modifiers, variables)); |
672 } | 673 } |
673 | 674 |
674 @override | 675 @override |
675 void endMethod(Token getOrSet, Token beginToken, Token endToken) { | 676 void endMethod(Token getOrSet, Token beginToken, Token endToken) { |
676 Statement body = popNode(); | 677 Statement body = popNode(); |
677 AsyncModifier asyncModifier = popNode(); | 678 AsyncModifier asyncModifier = popNode(); |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1012 } | 1013 } |
1013 lastErrorWasNativeFunctionBody = false; | 1014 lastErrorWasNativeFunctionBody = false; |
1014 } | 1015 } |
1015 | 1016 |
1016 void internalError({Token token, Node node}) { | 1017 void internalError({Token token, Node node}) { |
1017 // TODO(ahe): This should call reporter.internalError. | 1018 // TODO(ahe): This should call reporter.internalError. |
1018 Spannable spannable = (token == null) ? node : token; | 1019 Spannable spannable = (token == null) ? node : token; |
1019 throw new SpannableAssertionFailure(spannable, 'Internal error in parser.'); | 1020 throw new SpannableAssertionFailure(spannable, 'Internal error in parser.'); |
1020 } | 1021 } |
1021 } | 1022 } |
OLD | NEW |