| 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 "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/compiler_stats.h" | 10 #include "vm/compiler_stats.h" |
| (...skipping 4966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4977 // We found a switch scope. Enter a forward reference to the label. | 4977 // We found a switch scope. Enter a forward reference to the label. |
| 4978 target = new SourceLabel( | 4978 target = new SourceLabel( |
| 4979 token_index_, target_name, SourceLabel::kForward); | 4979 token_index_, target_name, SourceLabel::kForward); |
| 4980 switch_scope->AddLabel(target); | 4980 switch_scope->AddLabel(target); |
| 4981 } | 4981 } |
| 4982 } | 4982 } |
| 4983 if (target == NULL) { | 4983 if (target == NULL) { |
| 4984 ErrorMsg(jump_pos, "label '%s' not found", target_name.ToCString()); | 4984 ErrorMsg(jump_pos, "label '%s' not found", target_name.ToCString()); |
| 4985 } | 4985 } |
| 4986 } else { | 4986 } else { |
| 4987 target = current_block_->scope->LookupInnermostLabel(); | 4987 target = current_block_->scope->LookupInnermostLabel(jump_kind); |
| 4988 if (target == NULL) { | 4988 if (target == NULL) { |
| 4989 ErrorMsg(jump_pos, "'%s' is illegal here", Token::Str(jump_kind)); | 4989 ErrorMsg(jump_pos, "'%s' is illegal here", Token::Str(jump_kind)); |
| 4990 } | 4990 } |
| 4991 } | 4991 } |
| 4992 ASSERT(target != NULL); | 4992 ASSERT(target != NULL); |
| 4993 if (jump_kind == Token::kCONTINUE) { | 4993 if (jump_kind == Token::kCONTINUE) { |
| 4994 if (target->kind() == SourceLabel::kSwitch) { | 4994 if (target->kind() == SourceLabel::kSwitch) { |
| 4995 ErrorMsg(jump_pos, "'continue' jump to switch statement is illegal"); | 4995 ErrorMsg(jump_pos, "'continue' jump to switch statement is illegal"); |
| 4996 } else if (target->kind() == SourceLabel::kStatement) { | 4996 } else if (target->kind() == SourceLabel::kStatement) { |
| 4997 ErrorMsg(jump_pos, "'continue' jump to label '%s' is illegal", | 4997 ErrorMsg(jump_pos, "'continue' jump to label '%s' is illegal", |
| (...skipping 2762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7760 void Parser::SkipQualIdent() { | 7760 void Parser::SkipQualIdent() { |
| 7761 ASSERT(IsIdentifier()); | 7761 ASSERT(IsIdentifier()); |
| 7762 ConsumeToken(); | 7762 ConsumeToken(); |
| 7763 if (CurrentToken() == Token::kPERIOD) { | 7763 if (CurrentToken() == Token::kPERIOD) { |
| 7764 ConsumeToken(); // Consume the kPERIOD token. | 7764 ConsumeToken(); // Consume the kPERIOD token. |
| 7765 ExpectIdentifier("identifier expected after '.'"); | 7765 ExpectIdentifier("identifier expected after '.'"); |
| 7766 } | 7766 } |
| 7767 } | 7767 } |
| 7768 | 7768 |
| 7769 } // namespace dart | 7769 } // namespace dart |
| OLD | NEW |