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.analyzer.ast_builder; | 5 library fasta.analyzer.ast_builder; |
6 | 6 |
7 import 'package:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
8 import 'package:analyzer/dart/ast/ast_factory.dart' show AstFactory; | 8 import 'package:analyzer/dart/ast/ast_factory.dart' show AstFactory; |
9 import 'package:analyzer/dart/ast/standard_ast_factory.dart' as standard; | 9 import 'package:analyzer/dart/ast/standard_ast_factory.dart' as standard; |
10 import 'package:analyzer/dart/ast/token.dart' show Token, TokenType; | 10 import 'package:analyzer/dart/ast/token.dart' show Token, TokenType; |
(...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 SimpleIdentifier stackTrace; | 979 SimpleIdentifier stackTrace; |
980 if (catchParameterList != null) { | 980 if (catchParameterList != null) { |
981 List<FormalParameter> catchParameters = catchParameterList.parameters; | 981 List<FormalParameter> catchParameters = catchParameterList.parameters; |
982 if (catchParameters.length > 0) { | 982 if (catchParameters.length > 0) { |
983 exception = catchParameters[0].identifier; | 983 exception = catchParameters[0].identifier; |
984 } | 984 } |
985 if (catchParameters.length > 1) { | 985 if (catchParameters.length > 1) { |
986 stackTrace = catchParameters[1].identifier; | 986 stackTrace = catchParameters[1].identifier; |
987 } | 987 } |
988 } | 988 } |
| 989 // TODO(brianwilkerson) The parser needs to pass in the comma token. |
989 push(ast.catchClause( | 990 push(ast.catchClause( |
990 onKeyword, | 991 onKeyword, |
991 type, | 992 type, |
992 catchKeyword, | 993 catchKeyword, |
993 catchParameterList?.leftParenthesis, | 994 catchParameterList?.leftParenthesis, |
994 exception, | 995 exception, |
995 null, | 996 stackTrace == null ? null : stackTrace.token.previous, |
996 stackTrace, | 997 stackTrace, |
997 catchParameterList?.rightParenthesis, | 998 catchParameterList?.rightParenthesis, |
998 body)); | 999 body)); |
999 } | 1000 } |
1000 | 1001 |
1001 @override | 1002 @override |
1002 void handleFinallyBlock(Token finallyKeyword) { | 1003 void handleFinallyBlock(Token finallyKeyword) { |
1003 debugEvent("FinallyBlock"); | 1004 debugEvent("FinallyBlock"); |
1004 // The finally block is popped in "endTryStatement". | 1005 // The finally block is popped in "endTryStatement". |
1005 } | 1006 } |
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2055 } else if (identical('var', s)) { | 2056 } else if (identical('var', s)) { |
2056 finalConstOrVarKeyword = token; | 2057 finalConstOrVarKeyword = token; |
2057 } else if (identical('covariant', s)) { | 2058 } else if (identical('covariant', s)) { |
2058 covariantKeyword = token; | 2059 covariantKeyword = token; |
2059 } else { | 2060 } else { |
2060 unhandled("$s", "modifier", token.charOffset, null); | 2061 unhandled("$s", "modifier", token.charOffset, null); |
2061 } | 2062 } |
2062 } | 2063 } |
2063 } | 2064 } |
2064 } | 2065 } |
OLD | NEW |