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

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

Issue 22851003: Initial support for length guards on final fields. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/raw_object.h » ('j') | 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 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 2069 matching lines...) Expand 10 before | Expand all | Expand 10 after
2080 } 2080 }
2081 } 2081 }
2082 2082
2083 if (found) continue; 2083 if (found) continue;
2084 2084
2085 if (field.is_final()) { 2085 if (field.is_final()) {
2086 ErrorMsg("final field '%s' not initialized", 2086 ErrorMsg("final field '%s' not initialized",
2087 String::Handle(field.name()).ToCString()); 2087 String::Handle(field.name()).ToCString());
2088 } else { 2088 } else {
2089 field.UpdateCid(kNullCid); 2089 field.UpdateCid(kNullCid);
2090 field.UpdateLength(Field::kNoFixedLength);
2090 } 2091 }
2091 } 2092 }
2092 } 2093 }
2093 2094
2094 2095
2095 AstNode* Parser::ParseExternalInitializedField(const Field& field) { 2096 AstNode* Parser::ParseExternalInitializedField(const Field& field) {
2096 // Only use this function if the initialized field originates 2097 // Only use this function if the initialized field originates
2097 // from a different class. We need to save and restore current 2098 // from a different class. We need to save and restore current
2098 // class, library, and token stream (script). 2099 // class, library, and token stream (script).
2099 ASSERT(current_class().raw() != field.origin()); 2100 ASSERT(current_class().raw() != field.origin());
(...skipping 8228 matching lines...) Expand 10 before | Expand all | Expand 10 after
10328 void Parser::SkipQualIdent() { 10329 void Parser::SkipQualIdent() {
10329 ASSERT(IsIdentifier()); 10330 ASSERT(IsIdentifier());
10330 ConsumeToken(); 10331 ConsumeToken();
10331 if (CurrentToken() == Token::kPERIOD) { 10332 if (CurrentToken() == Token::kPERIOD) {
10332 ConsumeToken(); // Consume the kPERIOD token. 10333 ConsumeToken(); // Consume the kPERIOD token.
10333 ExpectIdentifier("identifier expected after '.'"); 10334 ExpectIdentifier("identifier expected after '.'");
10334 } 10335 }
10335 } 10336 }
10336 10337
10337 } // namespace dart 10338 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698