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 'package:front_end/src/fasta/parser/parser.dart' | 7 import 'package:front_end/src/fasta/parser/parser.dart' |
8 show FormalParameterType, MemberKind; | 8 show FormalParameterType, MemberKind; |
9 import 'package:front_end/src/fasta/parser/identifier_context.dart' | 9 import 'package:front_end/src/fasta/parser/identifier_context.dart' |
10 show IdentifierContext; | 10 show IdentifierContext; |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 NodeList typeVariables = popNode(); | 501 NodeList typeVariables = popNode(); |
502 // The name can be an identifier or a send in case of named constructors. | 502 // The name can be an identifier or a send in case of named constructors. |
503 Expression name = popNode(); | 503 Expression name = popNode(); |
504 TypeAnnotation type = popNode(); | 504 TypeAnnotation type = popNode(); |
505 Modifiers modifiers = popNode(); | 505 Modifiers modifiers = popNode(); |
506 pushNode(new FunctionExpression(name, typeVariables, formals, body, type, | 506 pushNode(new FunctionExpression(name, typeVariables, formals, body, type, |
507 modifiers, initializers, null, asyncModifier)); | 507 modifiers, initializers, null, asyncModifier)); |
508 } | 508 } |
509 | 509 |
510 @override | 510 @override |
511 void endFunctionDeclaration(Token endToken) { | 511 void endLocalFunctionDeclaration(Token endToken) { |
512 Statement body = popNode(); | 512 Statement body = popNode(); |
513 AsyncModifier asyncModifier = popNode(); | 513 AsyncModifier asyncModifier = popNode(); |
514 NodeList initializers = popNode(); | 514 NodeList initializers = popNode(); |
515 NodeList formals = popNode(); | 515 NodeList formals = popNode(); |
516 NodeList typeVariables = popNode(); | 516 NodeList typeVariables = popNode(); |
517 // The name can be an identifier or a send in case of named constructors. | 517 // The name can be an identifier or a send in case of named constructors. |
518 Expression name = popNode(); | 518 Expression name = popNode(); |
519 TypeAnnotation type = popNode(); | 519 TypeAnnotation type = popNode(); |
520 Modifiers modifiers = popNode(); | 520 Modifiers modifiers = popNode(); |
521 pushNode(new FunctionDeclaration(new FunctionExpression(name, typeVariables, | 521 pushNode(new FunctionDeclaration(new FunctionExpression(name, typeVariables, |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1068 } | 1068 } |
1069 lastErrorWasNativeFunctionBody = false; | 1069 lastErrorWasNativeFunctionBody = false; |
1070 } | 1070 } |
1071 | 1071 |
1072 void internalError({Token token, Node node}) { | 1072 void internalError({Token token, Node node}) { |
1073 // TODO(ahe): This should call reporter.internalError. | 1073 // TODO(ahe): This should call reporter.internalError. |
1074 Spannable spannable = (token == null) ? node : token; | 1074 Spannable spannable = (token == null) ? node : token; |
1075 failedAt(spannable, 'Internal error in parser.'); | 1075 failedAt(spannable, 'Internal error in parser.'); |
1076 } | 1076 } |
1077 } | 1077 } |
OLD | NEW |