| 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 9405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9416 primary = ParseNewOperator(); | 9416 primary = ParseNewOperator(); |
| 9417 } | 9417 } |
| 9418 } else if (CurrentToken() == Token::kLT || | 9418 } else if (CurrentToken() == Token::kLT || |
| 9419 CurrentToken() == Token::kLBRACK || | 9419 CurrentToken() == Token::kLBRACK || |
| 9420 CurrentToken() == Token::kINDEX || | 9420 CurrentToken() == Token::kINDEX || |
| 9421 CurrentToken() == Token::kLBRACE) { | 9421 CurrentToken() == Token::kLBRACE) { |
| 9422 primary = ParseCompoundLiteral(); | 9422 primary = ParseCompoundLiteral(); |
| 9423 } else if (CurrentToken() == Token::kSUPER) { | 9423 } else if (CurrentToken() == Token::kSUPER) { |
| 9424 if (current_function().is_static()) { | 9424 if (current_function().is_static()) { |
| 9425 ErrorMsg("cannot access superclass from static method"); | 9425 ErrorMsg("cannot access superclass from static method"); |
| 9426 } else if (current_function().IsLocalFunction()) { | |
| 9427 ErrorMsg("cannot access superclass from local function"); | |
| 9428 } | 9426 } |
| 9429 ConsumeToken(); | 9427 ConsumeToken(); |
| 9430 if (CurrentToken() == Token::kPERIOD) { | 9428 if (CurrentToken() == Token::kPERIOD) { |
| 9431 ConsumeToken(); | 9429 ConsumeToken(); |
| 9432 const String& ident = *ExpectIdentifier("identifier expected"); | 9430 const String& ident = *ExpectIdentifier("identifier expected"); |
| 9433 if (CurrentToken() == Token::kLPAREN) { | 9431 if (CurrentToken() == Token::kLPAREN) { |
| 9434 primary = ParseSuperCall(ident); | 9432 primary = ParseSuperCall(ident); |
| 9435 } else { | 9433 } else { |
| 9436 primary = ParseSuperFieldAccess(ident); | 9434 primary = ParseSuperFieldAccess(ident); |
| 9437 } | 9435 } |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9756 void Parser::SkipQualIdent() { | 9754 void Parser::SkipQualIdent() { |
| 9757 ASSERT(IsIdentifier()); | 9755 ASSERT(IsIdentifier()); |
| 9758 ConsumeToken(); | 9756 ConsumeToken(); |
| 9759 if (CurrentToken() == Token::kPERIOD) { | 9757 if (CurrentToken() == Token::kPERIOD) { |
| 9760 ConsumeToken(); // Consume the kPERIOD token. | 9758 ConsumeToken(); // Consume the kPERIOD token. |
| 9761 ExpectIdentifier("identifier expected after '.'"); | 9759 ExpectIdentifier("identifier expected after '.'"); |
| 9762 } | 9760 } |
| 9763 } | 9761 } |
| 9764 | 9762 |
| 9765 } // namespace dart | 9763 } // namespace dart |
| OLD | NEW |