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