| 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 8679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8690 "the element type"); | 8690 "the element type"); |
| 8691 } | 8691 } |
| 8692 if (is_const && !element_type.IsInstantiated()) { | 8692 if (is_const && !element_type.IsInstantiated()) { |
| 8693 ErrorMsg(type_pos, | 8693 ErrorMsg(type_pos, |
| 8694 "the type argument of a constant list literal cannot include " | 8694 "the type argument of a constant list literal cannot include " |
| 8695 "a type variable"); | 8695 "a type variable"); |
| 8696 } | 8696 } |
| 8697 } | 8697 } |
| 8698 ASSERT(type_arguments.IsNull() || (type_arguments.Length() == 1)); | 8698 ASSERT(type_arguments.IsNull() || (type_arguments.Length() == 1)); |
| 8699 const Class& array_class = Class::Handle( | 8699 const Class& array_class = Class::Handle( |
| 8700 Type::Handle(Type::ArrayType()).type_class()); | 8700 Isolate::Current()->object_store()->array_class()); |
| 8701 Type& type = Type::ZoneHandle( | 8701 Type& type = Type::ZoneHandle( |
| 8702 Type::New(array_class, type_arguments, type_pos)); | 8702 Type::New(array_class, type_arguments, type_pos)); |
| 8703 type ^= ClassFinalizer::FinalizeType( | 8703 type ^= ClassFinalizer::FinalizeType( |
| 8704 current_class(), type, ClassFinalizer::kCanonicalize); | 8704 current_class(), type, ClassFinalizer::kCanonicalize); |
| 8705 ArrayNode* list = new ArrayNode(TokenPos(), type); | 8705 ArrayNode* list = new ArrayNode(TokenPos(), type); |
| 8706 | 8706 |
| 8707 // Parse the list elements. Note: there may be an optional extra | 8707 // Parse the list elements. Note: there may be an optional extra |
| 8708 // comma after the last element. | 8708 // comma after the last element. |
| 8709 if (!is_empty_literal) { | 8709 if (!is_empty_literal) { |
| 8710 const bool saved_mode = SetAllowFunctionLiterals(true); | 8710 const bool saved_mode = SetAllowFunctionLiterals(true); |
| (...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10033 void Parser::SkipQualIdent() { | 10033 void Parser::SkipQualIdent() { |
| 10034 ASSERT(IsIdentifier()); | 10034 ASSERT(IsIdentifier()); |
| 10035 ConsumeToken(); | 10035 ConsumeToken(); |
| 10036 if (CurrentToken() == Token::kPERIOD) { | 10036 if (CurrentToken() == Token::kPERIOD) { |
| 10037 ConsumeToken(); // Consume the kPERIOD token. | 10037 ConsumeToken(); // Consume the kPERIOD token. |
| 10038 ExpectIdentifier("identifier expected after '.'"); | 10038 ExpectIdentifier("identifier expected after '.'"); |
| 10039 } | 10039 } |
| 10040 } | 10040 } |
| 10041 | 10041 |
| 10042 } // namespace dart | 10042 } // namespace dart |
| OLD | NEW |