Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Side by Side Diff: runtime/vm/parser.cc

Issue 24019007: Fix reparsing of function parameters that include type parameters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "vm/bigint_operations.h" 8 #include "vm/bigint_operations.h"
9 #include "vm/bootstrap.h" 9 #include "vm/bootstrap.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 ASSERT(!func.IsNull()); 768 ASSERT(!func.IsNull());
769 Isolate* isolate = Isolate::Current(); 769 Isolate* isolate = Isolate::Current();
770 StackZone zone(isolate); 770 StackZone zone(isolate);
771 LongJump* base = isolate->long_jump_base(); 771 LongJump* base = isolate->long_jump_base();
772 LongJump jump; 772 LongJump jump;
773 isolate->set_long_jump_base(&jump); 773 isolate->set_long_jump_base(&jump);
774 if (setjmp(*jump.Set()) == 0) { 774 if (setjmp(*jump.Set()) == 0) {
775 const Script& script = Script::Handle(isolate, func.script()); 775 const Script& script = Script::Handle(isolate, func.script());
776 const Class& owner = Class::Handle(isolate, func.Owner()); 776 const Class& owner = Class::Handle(isolate, func.Owner());
777 ASSERT(!owner.IsNull()); 777 ASSERT(!owner.IsNull());
778 const Library& lib = Library::Handle(isolate, owner.library()); 778 ParsedFunction* parsed_function = new ParsedFunction(
779 Parser parser(script, lib, func.token_pos()); 779 Function::ZoneHandle(func.raw()));
780 parser.set_current_class(owner); 780 Parser parser(script, parsed_function, func.token_pos());
781 parser.SkipFunctionPreamble(); 781 parser.SkipFunctionPreamble();
782 ParamList params; 782 ParamList params;
783 parser.ParseFormalParameterList(true, true, &params); 783 parser.ParseFormalParameterList(true, true, &params);
784 ParamDesc* param = params.parameters->data(); 784 ParamDesc* param = params.parameters->data();
785 const int param_cnt = params.num_fixed_parameters + 785 const int param_cnt = params.num_fixed_parameters +
786 params.num_optional_parameters; 786 params.num_optional_parameters;
787 const Array& param_descriptor = 787 const Array& param_descriptor =
788 Array::Handle(Array::New(param_cnt * kParameterEntrySize)); 788 Array::Handle(Array::New(param_cnt * kParameterEntrySize));
789 for (int i = 0, j = 0; i < param_cnt; i++, j += kParameterEntrySize) { 789 for (int i = 0, j = 0; i < param_cnt; i++, j += kParameterEntrySize) {
790 param_descriptor.SetAt(j + kParameterIsFinalOffset, 790 param_descriptor.SetAt(j + kParameterIsFinalOffset,
(...skipping 9597 matching lines...) Expand 10 before | Expand all | Expand 10 after
10388 void Parser::SkipQualIdent() { 10388 void Parser::SkipQualIdent() {
10389 ASSERT(IsIdentifier()); 10389 ASSERT(IsIdentifier());
10390 ConsumeToken(); 10390 ConsumeToken();
10391 if (CurrentToken() == Token::kPERIOD) { 10391 if (CurrentToken() == Token::kPERIOD) {
10392 ConsumeToken(); // Consume the kPERIOD token. 10392 ConsumeToken(); // Consume the kPERIOD token.
10393 ExpectIdentifier("identifier expected after '.'"); 10393 ExpectIdentifier("identifier expected after '.'");
10394 } 10394 }
10395 } 10395 }
10396 10396
10397 } // namespace dart 10397 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/lib/mirrors/parameter_test.dart » ('j') | tests/lib/mirrors/parameter_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698