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/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 6399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6410 while (node_to_inline != NULL) { | 6410 while (node_to_inline != NULL) { |
6411 finally_block = ParseFinallyBlock(); | 6411 finally_block = ParseFinallyBlock(); |
6412 InlinedFinallyNode* node = new InlinedFinallyNode(finally_pos, | 6412 InlinedFinallyNode* node = new InlinedFinallyNode(finally_pos, |
6413 finally_block, | 6413 finally_block, |
6414 context_var); | 6414 context_var); |
6415 AddFinallyBlockToNode(node_to_inline, node); | 6415 AddFinallyBlockToNode(node_to_inline, node); |
6416 node_index += 1; | 6416 node_index += 1; |
6417 node_to_inline = inner_try_block->GetNodeToInlineFinally(node_index); | 6417 node_to_inline = inner_try_block->GetNodeToInlineFinally(node_index); |
6418 tokens_iterator_.SetCurrentPosition(finally_pos); | 6418 tokens_iterator_.SetCurrentPosition(finally_pos); |
6419 } | 6419 } |
6420 if (!generic_catch_seen) { | |
6421 // No generic catch handler exists so execute this finally block | |
6422 // before rethrowing the exception. | |
6423 finally_block = ParseFinallyBlock(); | |
6424 catch_handler_list->Add(finally_block); | |
6425 tokens_iterator_.SetCurrentPosition(finally_pos); | |
6426 } | |
6427 finally_block = ParseFinallyBlock(); | 6420 finally_block = ParseFinallyBlock(); |
6428 } else { | 6421 } else { |
6429 if (!catch_seen) { | 6422 if (!catch_seen) { |
6430 ErrorMsg("catch or finally clause expected"); | 6423 ErrorMsg("catch or finally clause expected"); |
6431 } | 6424 } |
6432 } | 6425 } |
6433 | 6426 |
6434 if (!generic_catch_seen) { | 6427 if (!generic_catch_seen) { |
6435 // No generic catch handler exists so rethrow the exception so that | 6428 // No generic catch handler exists so rethrow the exception so that |
6436 // the next catch handler can deal with it. | 6429 // the next catch handler can deal with it. |
(...skipping 3715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10152 void Parser::SkipQualIdent() { | 10145 void Parser::SkipQualIdent() { |
10153 ASSERT(IsIdentifier()); | 10146 ASSERT(IsIdentifier()); |
10154 ConsumeToken(); | 10147 ConsumeToken(); |
10155 if (CurrentToken() == Token::kPERIOD) { | 10148 if (CurrentToken() == Token::kPERIOD) { |
10156 ConsumeToken(); // Consume the kPERIOD token. | 10149 ConsumeToken(); // Consume the kPERIOD token. |
10157 ExpectIdentifier("identifier expected after '.'"); | 10150 ExpectIdentifier("identifier expected after '.'"); |
10158 } | 10151 } |
10159 } | 10152 } |
10160 | 10153 |
10161 } // namespace dart | 10154 } // namespace dart |
OLD | NEW |