Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: runtime/vm/parser.cc

Issue 1568353002: Don't test directly against Scanner::kNoSourcePos instead use >= 0. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698