OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 #include "vm/parser.h" | 5 #include "vm/parser.h" |
6 | 6 |
7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
8 #include "vm/bigint_operations.h" | 8 #include "vm/bigint_operations.h" |
9 #include "vm/bootstrap.h" | 9 #include "vm/bootstrap.h" |
10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
(...skipping 6695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6706 ConsumeToken(); | 6706 ConsumeToken(); |
6707 // TODO(hausner): Make implicit type be StackTrace, not dynamic. | 6707 // TODO(hausner): Make implicit type be StackTrace, not dynamic. |
6708 stack_trace_param.type = | 6708 stack_trace_param.type = |
6709 &AbstractType::ZoneHandle(Type::DynamicType()); | 6709 &AbstractType::ZoneHandle(Type::DynamicType()); |
6710 stack_trace_param.token_pos = TokenPos(); | 6710 stack_trace_param.token_pos = TokenPos(); |
6711 stack_trace_param.var = ExpectIdentifier("identifier expected"); | 6711 stack_trace_param.var = ExpectIdentifier("identifier expected"); |
6712 } | 6712 } |
6713 ExpectToken(Token::kRPAREN); | 6713 ExpectToken(Token::kRPAREN); |
6714 } | 6714 } |
6715 | 6715 |
6716 // If a generic "catch all" statement has already been seen then all | |
6717 // subsequent catch statements are dead. We issue an error for now, | |
6718 // it might make sense to turn this into a warning. | |
6719 if (generic_catch_seen) { | |
6720 ErrorMsg("a generic 'catch all' statement already exists for this " | |
6721 "try block. All subsequent catch statements are dead code"); | |
6722 } | |
6723 OpenBlock(); | 6716 OpenBlock(); |
6724 AddCatchParamsToScope(exception_param, | 6717 AddCatchParamsToScope(exception_param, |
6725 stack_trace_param, | 6718 stack_trace_param, |
6726 current_block_->scope); | 6719 current_block_->scope); |
6727 | 6720 |
6728 // Parse the individual catch handler code and add an unconditional | 6721 // Parse the individual catch handler code and add an unconditional |
6729 // JUMP to the end of the try block. | 6722 // JUMP to the end of the try block. |
6730 ExpectToken(Token::kLBRACE); | 6723 ExpectToken(Token::kLBRACE); |
6731 OpenBlock(); | 6724 OpenBlock(); |
6732 | 6725 |
(...skipping 3842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10575 void Parser::SkipQualIdent() { | 10568 void Parser::SkipQualIdent() { |
10576 ASSERT(IsIdentifier()); | 10569 ASSERT(IsIdentifier()); |
10577 ConsumeToken(); | 10570 ConsumeToken(); |
10578 if (CurrentToken() == Token::kPERIOD) { | 10571 if (CurrentToken() == Token::kPERIOD) { |
10579 ConsumeToken(); // Consume the kPERIOD token. | 10572 ConsumeToken(); // Consume the kPERIOD token. |
10580 ExpectIdentifier("identifier expected after '.'"); | 10573 ExpectIdentifier("identifier expected after '.'"); |
10581 } | 10574 } |
10582 } | 10575 } |
10583 | 10576 |
10584 } // namespace dart | 10577 } // namespace dart |
OLD | NEW |