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 "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
9 #include "vm/bootstrap.h" | 9 #include "vm/bootstrap.h" |
10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
(...skipping 9787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9798 ConsumeToken(); | 9798 ConsumeToken(); |
9799 symbol = String::Concat(symbol, | 9799 symbol = String::Concat(symbol, |
9800 *ExpectIdentifier("identifier expected")); | 9800 *ExpectIdentifier("identifier expected")); |
9801 } | 9801 } |
9802 } else if (Token::CanBeOverloaded(CurrentToken())) { | 9802 } else if (Token::CanBeOverloaded(CurrentToken())) { |
9803 symbol = String::New(Token::Str(CurrentToken())); | 9803 symbol = String::New(Token::Str(CurrentToken())); |
9804 ConsumeToken(); | 9804 ConsumeToken(); |
9805 } else { | 9805 } else { |
9806 ErrorMsg("illegal symbol literal"); | 9806 ErrorMsg("illegal symbol literal"); |
9807 } | 9807 } |
9808 // Lookup class Symbol from collection_dev library and call the | 9808 // Lookup class Symbol from internal library and call the |
9809 // constructor to create a symbol instance. | 9809 // constructor to create a symbol instance. |
9810 const Library& lib = Library::Handle(Library::CollectionDevLibrary()); | 9810 const Library& lib = Library::Handle(Library::InternalLibrary()); |
9811 const Class& symbol_class = Class::Handle(lib.LookupClass(Symbols::Symbol())); | 9811 const Class& symbol_class = Class::Handle(lib.LookupClass(Symbols::Symbol())); |
9812 ASSERT(!symbol_class.IsNull()); | 9812 ASSERT(!symbol_class.IsNull()); |
9813 ArgumentListNode* constr_args = new ArgumentListNode(symbol_pos); | 9813 ArgumentListNode* constr_args = new ArgumentListNode(symbol_pos); |
9814 constr_args->Add(new LiteralNode( | 9814 constr_args->Add(new LiteralNode( |
9815 symbol_pos, String::ZoneHandle(Symbols::New(symbol)))); | 9815 symbol_pos, String::ZoneHandle(Symbols::New(symbol)))); |
9816 const Function& constr = Function::ZoneHandle( | 9816 const Function& constr = Function::ZoneHandle( |
9817 symbol_class.LookupConstructor(Symbols::SymbolCtor())); | 9817 symbol_class.LookupConstructor(Symbols::SymbolCtor())); |
9818 ASSERT(!constr.IsNull()); | 9818 ASSERT(!constr.IsNull()); |
9819 const Object& result = Object::Handle( | 9819 const Object& result = Object::Handle( |
9820 EvaluateConstConstructorCall(symbol_class, | 9820 EvaluateConstConstructorCall(symbol_class, |
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10750 void Parser::SkipQualIdent() { | 10750 void Parser::SkipQualIdent() { |
10751 ASSERT(IsIdentifier()); | 10751 ASSERT(IsIdentifier()); |
10752 ConsumeToken(); | 10752 ConsumeToken(); |
10753 if (CurrentToken() == Token::kPERIOD) { | 10753 if (CurrentToken() == Token::kPERIOD) { |
10754 ConsumeToken(); // Consume the kPERIOD token. | 10754 ConsumeToken(); // Consume the kPERIOD token. |
10755 ExpectIdentifier("identifier expected after '.'"); | 10755 ExpectIdentifier("identifier expected after '.'"); |
10756 } | 10756 } |
10757 } | 10757 } |
10758 | 10758 |
10759 } // namespace dart | 10759 } // namespace dart |
OLD | NEW |