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 3625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3636 | 3636 |
3637 while (true) { | 3637 while (true) { |
3638 set_current_class(Class::Handle()); // No current class. | 3638 set_current_class(Class::Handle()); // No current class. |
3639 if (CurrentToken() == Token::kCLASS) { | 3639 if (CurrentToken() == Token::kCLASS) { |
3640 ParseClassDefinition(pending_classes); | 3640 ParseClassDefinition(pending_classes); |
3641 } else if ((CurrentToken() == Token::kTYPEDEF) && | 3641 } else if ((CurrentToken() == Token::kTYPEDEF) && |
3642 (LookaheadToken(1) != Token::kLPAREN)) { | 3642 (LookaheadToken(1) != Token::kLPAREN)) { |
3643 ParseFunctionTypeAlias(pending_classes); | 3643 ParseFunctionTypeAlias(pending_classes); |
3644 } else if (CurrentToken() == Token::kINTERFACE) { | 3644 } else if (CurrentToken() == Token::kINTERFACE) { |
3645 ParseInterfaceDefinition(pending_classes); | 3645 ParseInterfaceDefinition(pending_classes); |
| 3646 } else if ((CurrentToken() == Token::kABSTRACT) && |
| 3647 (LookaheadToken(1) == Token::kCLASS)) { |
| 3648 ConsumeToken(); // Consume and ignore 'abstract'. |
| 3649 ParseClassDefinition(pending_classes); |
3646 } else { | 3650 } else { |
3647 set_current_class(toplevel_class); | 3651 set_current_class(toplevel_class); |
3648 if (IsVariableDeclaration()) { | 3652 if (IsVariableDeclaration()) { |
3649 ParseTopLevelVariable(&top_level); | 3653 ParseTopLevelVariable(&top_level); |
3650 } else if (IsFunctionDeclaration()) { | 3654 } else if (IsFunctionDeclaration()) { |
3651 ParseTopLevelFunction(&top_level); | 3655 ParseTopLevelFunction(&top_level); |
3652 } else if (IsTopLevelAccessor()) { | 3656 } else if (IsTopLevelAccessor()) { |
3653 ParseTopLevelAccessor(&top_level); | 3657 ParseTopLevelAccessor(&top_level); |
3654 } else if (CurrentToken() == Token::kEOS) { | 3658 } else if (CurrentToken() == Token::kEOS) { |
3655 break; | 3659 break; |
(...skipping 4715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8371 void Parser::SkipQualIdent() { | 8375 void Parser::SkipQualIdent() { |
8372 ASSERT(IsIdentifier()); | 8376 ASSERT(IsIdentifier()); |
8373 ConsumeToken(); | 8377 ConsumeToken(); |
8374 if (CurrentToken() == Token::kPERIOD) { | 8378 if (CurrentToken() == Token::kPERIOD) { |
8375 ConsumeToken(); // Consume the kPERIOD token. | 8379 ConsumeToken(); // Consume the kPERIOD token. |
8376 ExpectIdentifier("identifier expected after '.'"); | 8380 ExpectIdentifier("identifier expected after '.'"); |
8377 } | 8381 } |
8378 } | 8382 } |
8379 | 8383 |
8380 } // namespace dart | 8384 } // namespace dart |
OLD | NEW |