| 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 | 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |