| 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 "vm/bigint_operations.h" | 8 #include "vm/bigint_operations.h" |
| 9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 9812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9823 } else { | 9823 } else { |
| 9824 primary = ParseSuperFieldAccess(ident); | 9824 primary = ParseSuperFieldAccess(ident); |
| 9825 } | 9825 } |
| 9826 } else if ((CurrentToken() == Token::kLBRACK) || | 9826 } else if ((CurrentToken() == Token::kLBRACK) || |
| 9827 Token::CanBeOverloaded(CurrentToken()) || | 9827 Token::CanBeOverloaded(CurrentToken()) || |
| 9828 (CurrentToken() == Token::kNE)) { | 9828 (CurrentToken() == Token::kNE)) { |
| 9829 primary = ParseSuperOperator(); | 9829 primary = ParseSuperOperator(); |
| 9830 } else { | 9830 } else { |
| 9831 primary = new PrimaryNode(TokenPos(), Symbols::Super()); | 9831 primary = new PrimaryNode(TokenPos(), Symbols::Super()); |
| 9832 } | 9832 } |
| 9833 } else if (CurrentToken() == Token::kCONDITIONAL) { | |
| 9834 primary = ParseArgumentDefinitionTest(); | |
| 9835 } else { | 9833 } else { |
| 9836 UnexpectedToken(); | 9834 UnexpectedToken(); |
| 9837 } | 9835 } |
| 9838 return primary; | 9836 return primary; |
| 9839 } | 9837 } |
| 9840 | 9838 |
| 9841 | 9839 |
| 9842 // Evaluate expression in expr and return the value. The expression must | 9840 // Evaluate expression in expr and return the value. The expression must |
| 9843 // be a compile time constant. | 9841 // be a compile time constant. |
| 9844 const Instance& Parser::EvaluateConstExpr(AstNode* expr) { | 9842 const Instance& Parser::EvaluateConstExpr(AstNode* expr) { |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10024 } else { | 10022 } else { |
| 10025 SkipNewOperator(); | 10023 SkipNewOperator(); |
| 10026 } | 10024 } |
| 10027 break; | 10025 break; |
| 10028 case Token::kLT: | 10026 case Token::kLT: |
| 10029 case Token::kLBRACE: | 10027 case Token::kLBRACE: |
| 10030 case Token::kLBRACK: | 10028 case Token::kLBRACK: |
| 10031 case Token::kINDEX: | 10029 case Token::kINDEX: |
| 10032 SkipCompoundLiteral(); | 10030 SkipCompoundLiteral(); |
| 10033 break; | 10031 break; |
| 10034 case Token::kCONDITIONAL: | |
| 10035 ConsumeToken(); | |
| 10036 if (IsIdentifier()) { | |
| 10037 ConsumeToken(); | |
| 10038 } | |
| 10039 break; | |
| 10040 default: | 10032 default: |
| 10041 if (IsIdentifier()) { | 10033 if (IsIdentifier()) { |
| 10042 ConsumeToken(); // Handle pseudo-keyword identifiers. | 10034 ConsumeToken(); // Handle pseudo-keyword identifiers. |
| 10043 } else { | 10035 } else { |
| 10044 UnexpectedToken(); | 10036 UnexpectedToken(); |
| 10045 UNREACHABLE(); | 10037 UNREACHABLE(); |
| 10046 } | 10038 } |
| 10047 break; | 10039 break; |
| 10048 } | 10040 } |
| 10049 } | 10041 } |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10152 void Parser::SkipQualIdent() { | 10144 void Parser::SkipQualIdent() { |
| 10153 ASSERT(IsIdentifier()); | 10145 ASSERT(IsIdentifier()); |
| 10154 ConsumeToken(); | 10146 ConsumeToken(); |
| 10155 if (CurrentToken() == Token::kPERIOD) { | 10147 if (CurrentToken() == Token::kPERIOD) { |
| 10156 ConsumeToken(); // Consume the kPERIOD token. | 10148 ConsumeToken(); // Consume the kPERIOD token. |
| 10157 ExpectIdentifier("identifier expected after '.'"); | 10149 ExpectIdentifier("identifier expected after '.'"); |
| 10158 } | 10150 } |
| 10159 } | 10151 } |
| 10160 | 10152 |
| 10161 } // namespace dart | 10153 } // namespace dart |
| OLD | NEW |