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