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 4348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4359 } | 4359 } |
4360 const intptr_t ident_pos = TokenPos(); | 4360 const intptr_t ident_pos = TokenPos(); |
4361 if (IsIdentifier()) { | 4361 if (IsIdentifier()) { |
4362 variable_name = CurrentLiteral(); | 4362 variable_name = CurrentLiteral(); |
4363 function_name = variable_name; | 4363 function_name = variable_name; |
4364 ConsumeToken(); | 4364 ConsumeToken(); |
4365 } else { | 4365 } else { |
4366 if (!is_literal) { | 4366 if (!is_literal) { |
4367 ErrorMsg("function name expected"); | 4367 ErrorMsg("function name expected"); |
4368 } | 4368 } |
4369 function_name = &String::ZoneHandle(Symbols::Function()); | 4369 function_name = &String::ZoneHandle(Symbols::AnonymousClosure()); |
4370 } | 4370 } |
4371 ASSERT(ident_pos >= 0); | 4371 ASSERT(ident_pos >= 0); |
4372 | 4372 |
4373 if (CurrentToken() != Token::kLPAREN) { | 4373 if (CurrentToken() != Token::kLPAREN) { |
4374 ErrorMsg("'(' expected"); | 4374 ErrorMsg("'(' expected"); |
4375 } | 4375 } |
4376 intptr_t function_pos = TokenPos(); | 4376 intptr_t function_pos = TokenPos(); |
4377 | 4377 |
4378 // Check whether we have parsed this closure function before, in a previous | 4378 // Check whether we have parsed this closure function before, in a previous |
4379 // compilation. If so, reuse the function object, else create a new one | 4379 // compilation. If so, reuse the function object, else create a new one |
(...skipping 4564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8944 void Parser::SkipQualIdent() { | 8944 void Parser::SkipQualIdent() { |
8945 ASSERT(IsIdentifier()); | 8945 ASSERT(IsIdentifier()); |
8946 ConsumeToken(); | 8946 ConsumeToken(); |
8947 if (CurrentToken() == Token::kPERIOD) { | 8947 if (CurrentToken() == Token::kPERIOD) { |
8948 ConsumeToken(); // Consume the kPERIOD token. | 8948 ConsumeToken(); // Consume the kPERIOD token. |
8949 ExpectIdentifier("identifier expected after '.'"); | 8949 ExpectIdentifier("identifier expected after '.'"); |
8950 } | 8950 } |
8951 } | 8951 } |
8952 | 8952 |
8953 } // namespace dart | 8953 } // namespace dart |
OLD | NEW |