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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 void endVariableInitializer(Token assignmentOperator) { | 524 void endVariableInitializer(Token assignmentOperator) { |
525 Expression initializer = popNode(); | 525 Expression initializer = popNode(); |
526 NodeList arguments = | 526 NodeList arguments = |
527 initializer == null ? null : new NodeList.singleton(initializer); | 527 initializer == null ? null : new NodeList.singleton(initializer); |
528 Expression name = popNode(); | 528 Expression name = popNode(); |
529 Operator op = new Operator(assignmentOperator); | 529 Operator op = new Operator(assignmentOperator); |
530 pushNode(new SendSet(null, name, op, arguments)); | 530 pushNode(new SendSet(null, name, op, arguments)); |
531 } | 531 } |
532 | 532 |
533 @override | 533 @override |
534 void endFieldInitializer(Token assignmentOperator) { | 534 void endFieldInitializer(Token assignmentOperator, Token token) { |
535 endVariableInitializer(assignmentOperator); | 535 endVariableInitializer(assignmentOperator); |
536 } | 536 } |
537 | 537 |
538 @override | 538 @override |
539 void endIfStatement(Token ifToken, Token elseToken) { | 539 void endIfStatement(Token ifToken, Token elseToken) { |
540 Statement elsePart = (elseToken == null) ? null : popNode(); | 540 Statement elsePart = (elseToken == null) ? null : popNode(); |
541 Statement thenPart = popNode(); | 541 Statement thenPart = popNode(); |
542 ParenthesizedExpression condition = popNode(); | 542 ParenthesizedExpression condition = popNode(); |
543 pushNode(new If(condition, thenPart, elsePart, ifToken, elseToken)); | 543 pushNode(new If(condition, thenPart, elsePart, ifToken, elseToken)); |
544 } | 544 } |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1035 } | 1035 } |
1036 lastErrorWasNativeFunctionBody = false; | 1036 lastErrorWasNativeFunctionBody = false; |
1037 } | 1037 } |
1038 | 1038 |
1039 void internalError({Token token, Node node}) { | 1039 void internalError({Token token, Node node}) { |
1040 // TODO(ahe): This should call reporter.internalError. | 1040 // TODO(ahe): This should call reporter.internalError. |
1041 Spannable spannable = (token == null) ? node : token; | 1041 Spannable spannable = (token == null) ? node : token; |
1042 throw new SpannableAssertionFailure(spannable, 'Internal error in parser.'); | 1042 throw new SpannableAssertionFailure(spannable, 'Internal error in parser.'); |
1043 } | 1043 } |
1044 } | 1044 } |
OLD | NEW |