| 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 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 969 do { | 969 do { |
| 970 token = CurrentToken(); | 970 token = CurrentToken(); |
| 971 token_pos = TokenPos(); | 971 token_pos = TokenPos(); |
| 972 switch (token) { | 972 switch (token) { |
| 973 case Token::kLBRACE: | 973 case Token::kLBRACE: |
| 974 case Token::kLPAREN: | 974 case Token::kLPAREN: |
| 975 case Token::kLBRACK: | 975 case Token::kLBRACK: |
| 976 token_stack.Add(token); | 976 token_stack.Add(token); |
| 977 break; | 977 break; |
| 978 case Token::kRBRACE: | 978 case Token::kRBRACE: |
| 979 is_match = token_stack.Last() == Token::kLBRACE; | 979 is_match = token_stack.RemoveLast() == Token::kLBRACE; |
| 980 token_stack.RemoveLast(); | |
| 981 break; | 980 break; |
| 982 case Token::kRPAREN: | 981 case Token::kRPAREN: |
| 983 is_match = token_stack.Last() == Token::kLPAREN; | 982 is_match = token_stack.RemoveLast() == Token::kLPAREN; |
| 984 token_stack.RemoveLast(); | |
| 985 break; | 983 break; |
| 986 case Token::kRBRACK: | 984 case Token::kRBRACK: |
| 987 is_match = token_stack.Last() == Token::kLBRACK; | 985 is_match = token_stack.RemoveLast() == Token::kLBRACK; |
| 988 token_stack.RemoveLast(); | |
| 989 break; | 986 break; |
| 990 case Token::kEOS: | 987 case Token::kEOS: |
| 991 unexpected_token_found = true; | 988 unexpected_token_found = true; |
| 992 break; | 989 break; |
| 993 default: | 990 default: |
| 994 // nothing. | 991 // nothing. |
| 995 break; | 992 break; |
| 996 } | 993 } |
| 997 ConsumeToken(); | 994 ConsumeToken(); |
| 998 } while (!token_stack.is_empty() && is_match && !unexpected_token_found); | 995 } while (!token_stack.is_empty() && is_match && !unexpected_token_found); |
| (...skipping 8789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9788 void Parser::SkipQualIdent() { | 9785 void Parser::SkipQualIdent() { |
| 9789 ASSERT(IsIdentifier()); | 9786 ASSERT(IsIdentifier()); |
| 9790 ConsumeToken(); | 9787 ConsumeToken(); |
| 9791 if (CurrentToken() == Token::kPERIOD) { | 9788 if (CurrentToken() == Token::kPERIOD) { |
| 9792 ConsumeToken(); // Consume the kPERIOD token. | 9789 ConsumeToken(); // Consume the kPERIOD token. |
| 9793 ExpectIdentifier("identifier expected after '.'"); | 9790 ExpectIdentifier("identifier expected after '.'"); |
| 9794 } | 9791 } |
| 9795 } | 9792 } |
| 9796 | 9793 |
| 9797 } // namespace dart | 9794 } // namespace dart |
| OLD | NEW |