| 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 #include "vm/flags.h" | 6 #include "vm/flags.h" |
| 7 | 7 |
| 8 #ifndef DART_PRECOMPILED | 8 #ifndef DART_PRECOMPILED |
| 9 | 9 |
| 10 #include "lib/invocation_mirror.h" | 10 #include "lib/invocation_mirror.h" |
| (...skipping 7549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7560 variable = new(Z) LocalVariable( | 7560 variable = new(Z) LocalVariable( |
| 7561 assign_pos, ident, type); | 7561 assign_pos, ident, type); |
| 7562 AstNode* null_expr = new(Z) LiteralNode(ident_pos, Object::null_instance()); | 7562 AstNode* null_expr = new(Z) LiteralNode(ident_pos, Object::null_instance()); |
| 7563 initialization = new(Z) StoreLocalNode( | 7563 initialization = new(Z) StoreLocalNode( |
| 7564 ident_pos, variable, null_expr); | 7564 ident_pos, variable, null_expr); |
| 7565 } | 7565 } |
| 7566 | 7566 |
| 7567 ASSERT(current_block_ != NULL); | 7567 ASSERT(current_block_ != NULL); |
| 7568 const intptr_t previous_pos = | 7568 const intptr_t previous_pos = |
| 7569 current_block_->scope->PreviousReferencePos(ident); | 7569 current_block_->scope->PreviousReferencePos(ident); |
| 7570 if (previous_pos != Scanner::kNoSourcePos) { | 7570 if (previous_pos >= 0) { |
| 7571 ASSERT(!script_.IsNull()); | 7571 ASSERT(!script_.IsNull()); |
| 7572 if (previous_pos > ident_pos) { | 7572 if (previous_pos > ident_pos) { |
| 7573 ReportError(ident_pos, | 7573 ReportError(ident_pos, |
| 7574 "initializer of '%s' may not refer to itself", | 7574 "initializer of '%s' may not refer to itself", |
| 7575 ident.ToCString()); | 7575 ident.ToCString()); |
| 7576 | 7576 |
| 7577 } else { | 7577 } else { |
| 7578 intptr_t line_number; | 7578 intptr_t line_number; |
| 7579 script_.GetTokenLocation(previous_pos, &line_number, NULL); | 7579 script_.GetTokenLocation(previous_pos, &line_number, NULL); |
| 7580 ReportError(ident_pos, | 7580 ReportError(ident_pos, |
| (...skipping 6996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14577 const ArgumentListNode& function_args, | 14577 const ArgumentListNode& function_args, |
| 14578 const LocalVariable* temp_for_last_arg, | 14578 const LocalVariable* temp_for_last_arg, |
| 14579 bool is_super_invocation) { | 14579 bool is_super_invocation) { |
| 14580 UNREACHABLE(); | 14580 UNREACHABLE(); |
| 14581 return NULL; | 14581 return NULL; |
| 14582 } | 14582 } |
| 14583 | 14583 |
| 14584 } // namespace dart | 14584 } // namespace dart |
| 14585 | 14585 |
| 14586 #endif // DART_PRECOMPILED | 14586 #endif // DART_PRECOMPILED |
| OLD | NEW |