| OLD | NEW |
| 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.body_builder; | 5 library fasta.body_builder; |
| 6 | 6 |
| 7 import 'package:kernel/ast.dart' | 7 import 'package:kernel/ast.dart' |
| 8 hide InvalidExpression, InvalidInitializer, InvalidStatement; | 8 hide InvalidExpression, InvalidInitializer, InvalidStatement; |
| 9 | 9 |
| 10 import 'package:kernel/class_hierarchy.dart' show ClassHierarchy; | 10 import 'package:kernel/class_hierarchy.dart' show ClassHierarchy; |
| (...skipping 2798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2809 } else { | 2809 } else { |
| 2810 scope.declareLabel(label.name, createGotoTarget(firstToken.charOffset)); | 2810 scope.declareLabel(label.name, createGotoTarget(firstToken.charOffset)); |
| 2811 } | 2811 } |
| 2812 } | 2812 } |
| 2813 push(expressions); | 2813 push(expressions); |
| 2814 push(labels); | 2814 push(labels); |
| 2815 enterLocalScope(); | 2815 enterLocalScope(); |
| 2816 } | 2816 } |
| 2817 | 2817 |
| 2818 @override | 2818 @override |
| 2819 void handleSwitchCase( | 2819 void endSwitchCase(int labelCount, int expressionCount, Token defaultKeyword, |
| 2820 int labelCount, | 2820 int statementCount, Token firstToken, Token endToken) { |
| 2821 int expressionCount, | |
| 2822 Token defaultKeyword, | |
| 2823 int statementCount, | |
| 2824 Token firstToken, | |
| 2825 Token endToken) { | |
| 2826 debugEvent("SwitchCase"); | 2821 debugEvent("SwitchCase"); |
| 2827 // We always create a block here so that we later know that there's always | 2822 // We always create a block here so that we later know that there's always |
| 2828 // one synthetic block when we finish compiling the switch statement and | 2823 // one synthetic block when we finish compiling the switch statement and |
| 2829 // check this switch case to see if it falls through to the next case. | 2824 // check this switch case to see if it falls through to the next case. |
| 2830 Block block = popBlock(statementCount, firstToken); | 2825 Block block = popBlock(statementCount, firstToken); |
| 2831 exitLocalScope(); | 2826 exitLocalScope(); |
| 2832 List<Label> labels = pop(); | 2827 List<Label> labels = pop(); |
| 2833 List<Expression> expressions = pop(); | 2828 List<Expression> expressions = pop(); |
| 2834 List<int> expressionOffsets = <int>[]; | 2829 List<int> expressionOffsets = <int>[]; |
| 2835 for (Expression expression in expressions) { | 2830 for (Expression expression in expressions) { |
| (...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3813 return AsyncMarker.Async; | 3808 return AsyncMarker.Async; |
| 3814 } else { | 3809 } else { |
| 3815 assert(identical(starToken.stringValue, "*")); | 3810 assert(identical(starToken.stringValue, "*")); |
| 3816 return AsyncMarker.AsyncStar; | 3811 return AsyncMarker.AsyncStar; |
| 3817 } | 3812 } |
| 3818 } else { | 3813 } else { |
| 3819 return unhandled(asyncToken.lexeme, "asyncMarkerFromTokens", | 3814 return unhandled(asyncToken.lexeme, "asyncMarkerFromTokens", |
| 3820 asyncToken.charOffset, null); | 3815 asyncToken.charOffset, null); |
| 3821 } | 3816 } |
| 3822 } | 3817 } |
| OLD | NEW |