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 6080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6091 // outermost enclosing function. | 6091 // outermost enclosing function. |
6092 const bool kTestOnly = false; | 6092 const bool kTestOnly = false; |
6093 LocalVariable* receiver = LookupReceiver(current_block_->scope, kTestOnly); | 6093 LocalVariable* receiver = LookupReceiver(current_block_->scope, kTestOnly); |
6094 if (receiver == NULL) { | 6094 if (receiver == NULL) { |
6095 ReportError(token_pos, "illegal implicit access to receiver 'this'"); | 6095 ReportError(token_pos, "illegal implicit access to receiver 'this'"); |
6096 } | 6096 } |
6097 return new(I) LoadLocalNode(TokenPos(), receiver); | 6097 return new(I) LoadLocalNode(TokenPos(), receiver); |
6098 } | 6098 } |
6099 | 6099 |
6100 | 6100 |
6101 AstNode* Parser::LoadTypeArgumentsParameter(intptr_t token_pos) { | |
6102 // A nested function may access ':type_arguments' to use as instantiator, | |
6103 // referring to the implicit first parameter of the outermost enclosing | |
6104 // factory function. | |
6105 const bool kTestOnly = false; | |
6106 LocalVariable* param = LookupTypeArgumentsParameter(current_block_->scope, | |
6107 kTestOnly); | |
6108 ASSERT(param != NULL); | |
6109 return new(I) LoadLocalNode(TokenPos(), param); | |
6110 } | |
6111 | |
6112 | |
6113 AstNode* Parser::CallGetter(intptr_t token_pos, | 6101 AstNode* Parser::CallGetter(intptr_t token_pos, |
6114 AstNode* object, | 6102 AstNode* object, |
6115 const String& name) { | 6103 const String& name) { |
6116 return new(I) InstanceGetterNode(token_pos, object, name); | 6104 return new(I) InstanceGetterNode(token_pos, object, name); |
6117 } | 6105 } |
6118 | 6106 |
6119 | 6107 |
6120 // Returns ast nodes of the variable initialization. | 6108 // Returns ast nodes of the variable initialization. |
6121 AstNode* Parser::ParseVariableDeclaration(const AbstractType& type, | 6109 AstNode* Parser::ParseVariableDeclaration(const AbstractType& type, |
6122 bool is_final, | 6110 bool is_final, |
(...skipping 5781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11904 void Parser::SkipQualIdent() { | 11892 void Parser::SkipQualIdent() { |
11905 ASSERT(IsIdentifier()); | 11893 ASSERT(IsIdentifier()); |
11906 ConsumeToken(); | 11894 ConsumeToken(); |
11907 if (CurrentToken() == Token::kPERIOD) { | 11895 if (CurrentToken() == Token::kPERIOD) { |
11908 ConsumeToken(); // Consume the kPERIOD token. | 11896 ConsumeToken(); // Consume the kPERIOD token. |
11909 ExpectIdentifier("identifier expected after '.'"); | 11897 ExpectIdentifier("identifier expected after '.'"); |
11910 } | 11898 } |
11911 } | 11899 } |
11912 | 11900 |
11913 } // namespace dart | 11901 } // namespace dart |
OLD | NEW |