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/ast_transformer.h" | 9 #include "vm/ast_transformer.h" |
10 #include "vm/bootstrap.h" | 10 #include "vm/bootstrap.h" |
(...skipping 12866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12877 ParseFormalParameters(ctr, ¶ms); | 12877 ParseFormalParameters(ctr, ¶ms); |
12878 // Per language spec, the type of the closure parameters is dynamic. | 12878 // Per language spec, the type of the closure parameters is dynamic. |
12879 // Replace the types parsed from the constructor. | 12879 // Replace the types parsed from the constructor. |
12880 params.EraseParameterTypes(); | 12880 params.EraseParameterTypes(); |
12881 | 12881 |
12882 closure = Function::NewClosureFunction(closure_name, | 12882 closure = Function::NewClosureFunction(closure_name, |
12883 innermost_function(), | 12883 innermost_function(), |
12884 token_pos); | 12884 token_pos); |
12885 closure.set_is_generated_body(true); | 12885 closure.set_is_generated_body(true); |
12886 closure.set_is_debuggable(false); | 12886 closure.set_is_debuggable(false); |
| 12887 closure.set_is_visible(false); |
12887 closure.set_result_type(AbstractType::Handle(Type::DynamicType())); | 12888 closure.set_result_type(AbstractType::Handle(Type::DynamicType())); |
12888 AddFormalParamsToFunction(¶ms, closure); | 12889 AddFormalParamsToFunction(¶ms, closure); |
12889 | 12890 |
12890 // Create and set the signature class of the closure. | 12891 // Create and set the signature class of the closure. |
12891 const String& sig = String::Handle(Z, closure.Signature()); | 12892 const String& sig = String::Handle(Z, closure.Signature()); |
12892 Class& sig_cls = Class::Handle(Z, library_.LookupLocalClass(sig)); | 12893 Class& sig_cls = Class::Handle(Z, library_.LookupLocalClass(sig)); |
12893 if (sig_cls.IsNull()) { | 12894 if (sig_cls.IsNull()) { |
12894 sig_cls = Class::NewSignatureClass(sig, closure, script_, token_pos); | 12895 sig_cls = Class::NewSignatureClass(sig, closure, script_, token_pos); |
12895 library_.AddClass(sig_cls); | 12896 library_.AddClass(sig_cls); |
12896 } | 12897 } |
(...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14061 void Parser::SkipQualIdent() { | 14062 void Parser::SkipQualIdent() { |
14062 ASSERT(IsIdentifier()); | 14063 ASSERT(IsIdentifier()); |
14063 ConsumeToken(); | 14064 ConsumeToken(); |
14064 if (CurrentToken() == Token::kPERIOD) { | 14065 if (CurrentToken() == Token::kPERIOD) { |
14065 ConsumeToken(); // Consume the kPERIOD token. | 14066 ConsumeToken(); // Consume the kPERIOD token. |
14066 ExpectIdentifier("identifier expected after '.'"); | 14067 ExpectIdentifier("identifier expected after '.'"); |
14067 } | 14068 } |
14068 } | 14069 } |
14069 | 14070 |
14070 } // namespace dart | 14071 } // namespace dart |
OLD | NEW |