| 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 5512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5523 intptr_t accessor_end_pos = accessor_pos; | 5523 intptr_t accessor_end_pos = accessor_pos; |
| 5524 bool is_native = false; | 5524 bool is_native = false; |
| 5525 if (is_external) { | 5525 if (is_external) { |
| 5526 accessor_end_pos = TokenPos(); | 5526 accessor_end_pos = TokenPos(); |
| 5527 ExpectSemicolon(); | 5527 ExpectSemicolon(); |
| 5528 } else if (CurrentToken() == Token::kLBRACE) { | 5528 } else if (CurrentToken() == Token::kLBRACE) { |
| 5529 SkipBlock(); | 5529 SkipBlock(); |
| 5530 accessor_end_pos = TokenPos(); | 5530 accessor_end_pos = TokenPos(); |
| 5531 ExpectToken(Token::kRBRACE); | 5531 ExpectToken(Token::kRBRACE); |
| 5532 } else if (CurrentToken() == Token::kARROW) { | 5532 } else if (CurrentToken() == Token::kARROW) { |
| 5533 if (is_getter && ((func_modifier & RawFunction::kGeneratorBit) != 0)) { |
| 5534 ReportError(modifier_pos, |
| 5535 "=> style getter may not be sync* or async* generator"); |
| 5536 } |
| 5533 ConsumeToken(); | 5537 ConsumeToken(); |
| 5538 BoolScope allow_await(&this->await_is_keyword_, |
| 5539 func_modifier != RawFunction::kNoModifier); |
| 5534 SkipExpr(); | 5540 SkipExpr(); |
| 5535 accessor_end_pos = TokenPos(); | 5541 accessor_end_pos = TokenPos(); |
| 5536 ExpectSemicolon(); | 5542 ExpectSemicolon(); |
| 5537 } else if (IsLiteral("native")) { | 5543 } else if (IsLiteral("native")) { |
| 5538 ParseNativeDeclaration(); | 5544 ParseNativeDeclaration(); |
| 5539 accessor_end_pos = TokenPos(); | 5545 accessor_end_pos = TokenPos(); |
| 5540 ExpectSemicolon(); | 5546 ExpectSemicolon(); |
| 5541 is_native = true; | 5547 is_native = true; |
| 5542 } else { | 5548 } else { |
| 5543 ReportError("function block expected"); | 5549 ReportError("function block expected"); |
| (...skipping 7658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13202 void Parser::SkipQualIdent() { | 13208 void Parser::SkipQualIdent() { |
| 13203 ASSERT(IsIdentifier()); | 13209 ASSERT(IsIdentifier()); |
| 13204 ConsumeToken(); | 13210 ConsumeToken(); |
| 13205 if (CurrentToken() == Token::kPERIOD) { | 13211 if (CurrentToken() == Token::kPERIOD) { |
| 13206 ConsumeToken(); // Consume the kPERIOD token. | 13212 ConsumeToken(); // Consume the kPERIOD token. |
| 13207 ExpectIdentifier("identifier expected after '.'"); | 13213 ExpectIdentifier("identifier expected after '.'"); |
| 13208 } | 13214 } |
| 13209 } | 13215 } |
| 13210 | 13216 |
| 13211 } // namespace dart | 13217 } // namespace dart |
| OLD | NEW |