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

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
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::kNoLength);
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 8217 matching lines...) Expand 10 before | Expand all | Expand 10 after
10317 void Parser::SkipQualIdent() { 10318 void Parser::SkipQualIdent() {
10318 ASSERT(IsIdentifier()); 10319 ASSERT(IsIdentifier());
10319 ConsumeToken(); 10320 ConsumeToken();
10320 if (CurrentToken() == Token::kPERIOD) { 10321 if (CurrentToken() == Token::kPERIOD) {
10321 ConsumeToken(); // Consume the kPERIOD token. 10322 ConsumeToken(); // Consume the kPERIOD token.
10322 ExpectIdentifier("identifier expected after '.'"); 10323 ExpectIdentifier("identifier expected after '.'");
10323 } 10324 }
10324 } 10325 }
10325 10326
10326 } // namespace dart 10327 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698