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 8760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8771 String::Handle(element_type.UserVisibleName()).ToCString()); | 8771 String::Handle(element_type.UserVisibleName()).ToCString()); |
8772 } | 8772 } |
8773 } | 8773 } |
8774 const_list.SetAt(i, elem->AsLiteralNode()->literal()); | 8774 const_list.SetAt(i, elem->AsLiteralNode()->literal()); |
8775 } | 8775 } |
8776 const_list ^= const_list.Canonicalize(); | 8776 const_list ^= const_list.Canonicalize(); |
8777 const_list.MakeImmutable(); | 8777 const_list.MakeImmutable(); |
8778 return new LiteralNode(literal_pos, const_list); | 8778 return new LiteralNode(literal_pos, const_list); |
8779 } else { | 8779 } else { |
8780 // Factory call at runtime. | 8780 // Factory call at runtime. |
8781 // TODO(regis): Once _ListImpl is removed, use Symbols::List() instead of | 8781 String& factory_class_name = String::Handle(Symbols::List()); |
8782 // Symbols::ListImplementation() on the following line. | |
8783 String& factory_class_name = String::Handle(Symbols::ListImplementation()); | |
8784 const Class& factory_class = | 8782 const Class& factory_class = |
8785 Class::Handle(LookupCoreClass(factory_class_name)); | 8783 Class::Handle(LookupCoreClass(factory_class_name)); |
8786 ASSERT(!factory_class.IsNull()); | 8784 ASSERT(!factory_class.IsNull()); |
8787 const String& factory_method_name = | 8785 const String& factory_method_name = |
8788 String::Handle(Symbols::ListLiteralFactory()); | 8786 String::Handle(Symbols::ListLiteralFactory()); |
8789 const Function& factory_method = Function::ZoneHandle( | 8787 const Function& factory_method = Function::ZoneHandle( |
8790 factory_class.LookupFactory(factory_method_name)); | 8788 factory_class.LookupFactory(factory_method_name)); |
8791 ASSERT(!factory_method.IsNull()); | 8789 ASSERT(!factory_method.IsNull()); |
8792 if (!type_arguments.IsNull() && | 8790 if (!type_arguments.IsNull() && |
8793 !type_arguments.IsInstantiated() && | 8791 !type_arguments.IsInstantiated() && |
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10045 void Parser::SkipQualIdent() { | 10043 void Parser::SkipQualIdent() { |
10046 ASSERT(IsIdentifier()); | 10044 ASSERT(IsIdentifier()); |
10047 ConsumeToken(); | 10045 ConsumeToken(); |
10048 if (CurrentToken() == Token::kPERIOD) { | 10046 if (CurrentToken() == Token::kPERIOD) { |
10049 ConsumeToken(); // Consume the kPERIOD token. | 10047 ConsumeToken(); // Consume the kPERIOD token. |
10050 ExpectIdentifier("identifier expected after '.'"); | 10048 ExpectIdentifier("identifier expected after '.'"); |
10051 } | 10049 } |
10052 } | 10050 } |
10053 | 10051 |
10054 } // namespace dart | 10052 } // namespace dart |
OLD | NEW |