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

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

Issue 9958018: Report error on missing factory class (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 | « no previous file | tests/co19/co19-runtime.status » ('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 "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 2910 matching lines...) Expand 10 before | Expand all | Expand 10 after
2921 } 2921 }
2922 } 2922 }
2923 2923
2924 ExpectToken(Token::kLBRACE); 2924 ExpectToken(Token::kLBRACE);
2925 ClassDesc members(interface, interface_name, true, interface_pos); 2925 ClassDesc members(interface, interface_name, true, interface_pos);
2926 while (CurrentToken() != Token::kRBRACE) { 2926 while (CurrentToken() != Token::kRBRACE) {
2927 ParseClassMemberDefinition(&members); 2927 ParseClassMemberDefinition(&members);
2928 } 2928 }
2929 ExpectToken(Token::kRBRACE); 2929 ExpectToken(Token::kRBRACE);
2930 2930
2931 if (members.has_constructor() && !interface.HasFactoryClass()) {
2932 ErrorMsg(interfacename_pos,
2933 "interface '%s' with constructor must declare a factory class",
2934 interface_name.ToCString());
2935 }
2936
2931 Array& array = Array::Handle(); 2937 Array& array = Array::Handle();
2932 array = Array::MakeArray(members.fields()); 2938 array = Array::MakeArray(members.fields());
2933 interface.SetFields(array); 2939 interface.SetFields(array);
2934 2940
2935 // Creating a new array for functions marks the interface as parsed. 2941 // Creating a new array for functions marks the interface as parsed.
2936 array = Array::MakeArray(members.functions()); 2942 array = Array::MakeArray(members.functions());
2937 interface.SetFunctions(array); 2943 interface.SetFunctions(array);
2938 ASSERT(interface.is_interface()); 2944 ASSERT(interface.is_interface());
2939 2945
2940 pending_classes.Add(interface, Heap::kOld); 2946 pending_classes.Add(interface, Heap::kOld);
(...skipping 5311 matching lines...) Expand 10 before | Expand all | Expand 10 after
8252 void Parser::SkipQualIdent() { 8258 void Parser::SkipQualIdent() {
8253 ASSERT(IsIdentifier()); 8259 ASSERT(IsIdentifier());
8254 ConsumeToken(); 8260 ConsumeToken();
8255 if (CurrentToken() == Token::kPERIOD) { 8261 if (CurrentToken() == Token::kPERIOD) {
8256 ConsumeToken(); // Consume the kPERIOD token. 8262 ConsumeToken(); // Consume the kPERIOD token.
8257 ExpectIdentifier("identifier expected after '.'"); 8263 ExpectIdentifier("identifier expected after '.'");
8258 } 8264 }
8259 } 8265 }
8260 8266
8261 } // namespace dart 8267 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698