| 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 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1841 | 1841 |
| 1842 ArgumentListNode* arguments = new ArgumentListNode(call_pos); | 1842 ArgumentListNode* arguments = new ArgumentListNode(call_pos); |
| 1843 // 'this' parameter is the first argument to constructor. | 1843 // 'this' parameter is the first argument to constructor. |
| 1844 AstNode* implicit_argument = new LoadLocalNode(call_pos, receiver); | 1844 AstNode* implicit_argument = new LoadLocalNode(call_pos, receiver); |
| 1845 arguments->Add(implicit_argument); | 1845 arguments->Add(implicit_argument); |
| 1846 // Construction phase parameter is second argument. | 1846 // Construction phase parameter is second argument. |
| 1847 LocalVariable* phase_param = LookupPhaseParameter(); | 1847 LocalVariable* phase_param = LookupPhaseParameter(); |
| 1848 ASSERT(phase_param != NULL); | 1848 ASSERT(phase_param != NULL); |
| 1849 AstNode* phase_argument = new LoadLocalNode(call_pos, phase_param); | 1849 AstNode* phase_argument = new LoadLocalNode(call_pos, phase_param); |
| 1850 arguments->Add(phase_argument); | 1850 arguments->Add(phase_argument); |
| 1851 receiver->set_invisible(true); |
| 1851 ParseActualParameters(arguments, kAllowConst); | 1852 ParseActualParameters(arguments, kAllowConst); |
| 1852 | 1853 receiver->set_invisible(false); |
| 1853 // Resolve the constructor. | 1854 // Resolve the constructor. |
| 1854 const Function& redirect_ctor = Function::ZoneHandle( | 1855 const Function& redirect_ctor = Function::ZoneHandle( |
| 1855 cls.LookupConstructor(ctor_name)); | 1856 cls.LookupConstructor(ctor_name)); |
| 1856 if (redirect_ctor.IsNull()) { | 1857 if (redirect_ctor.IsNull()) { |
| 1857 ErrorMsg(call_pos, "constructor '%s' not found", ctor_name.ToCString()); | 1858 ErrorMsg(call_pos, "constructor '%s' not found", ctor_name.ToCString()); |
| 1858 } | 1859 } |
| 1859 String& error_message = String::Handle(); | 1860 String& error_message = String::Handle(); |
| 1860 if (!redirect_ctor.AreValidArguments(arguments->length(), | 1861 if (!redirect_ctor.AreValidArguments(arguments->length(), |
| 1861 arguments->names(), | 1862 arguments->names(), |
| 1862 &error_message)) { | 1863 &error_message)) { |
| (...skipping 7877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9740 void Parser::SkipQualIdent() { | 9741 void Parser::SkipQualIdent() { |
| 9741 ASSERT(IsIdentifier()); | 9742 ASSERT(IsIdentifier()); |
| 9742 ConsumeToken(); | 9743 ConsumeToken(); |
| 9743 if (CurrentToken() == Token::kPERIOD) { | 9744 if (CurrentToken() == Token::kPERIOD) { |
| 9744 ConsumeToken(); // Consume the kPERIOD token. | 9745 ConsumeToken(); // Consume the kPERIOD token. |
| 9745 ExpectIdentifier("identifier expected after '.'"); | 9746 ExpectIdentifier("identifier expected after '.'"); |
| 9746 } | 9747 } |
| 9747 } | 9748 } |
| 9748 | 9749 |
| 9749 } // namespace dart | 9750 } // namespace dart |
| OLD | NEW |