| 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 4670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4681 } | 4681 } |
| 4682 | 4682 |
| 4683 | 4683 |
| 4684 bool Parser::IsSimpleLiteral(const AbstractType& type, Instance* value) { | 4684 bool Parser::IsSimpleLiteral(const AbstractType& type, Instance* value) { |
| 4685 bool no_check = type.IsDynamicType(); | 4685 bool no_check = type.IsDynamicType(); |
| 4686 if ((CurrentToken() == Token::kINTEGER) && | 4686 if ((CurrentToken() == Token::kINTEGER) && |
| 4687 (no_check || type.IsIntInterface() || type.IsNumberType())) { | 4687 (no_check || type.IsIntInterface() || type.IsNumberType())) { |
| 4688 *value = CurrentIntegerLiteral(); | 4688 *value = CurrentIntegerLiteral(); |
| 4689 return true; | 4689 return true; |
| 4690 } else if ((CurrentToken() == Token::kDOUBLE) && | 4690 } else if ((CurrentToken() == Token::kDOUBLE) && |
| 4691 (no_check || type.IsDoubleInterface() || type.IsNumberType())) { | 4691 (no_check || type.IsDoubleType() || type.IsNumberType())) { |
| 4692 *value = CurrentDoubleLiteral(); | 4692 *value = CurrentDoubleLiteral(); |
| 4693 return true; | 4693 return true; |
| 4694 } else if ((CurrentToken() == Token::kSTRING) && | 4694 } else if ((CurrentToken() == Token::kSTRING) && |
| 4695 (no_check || type.IsStringInterface())) { | 4695 (no_check || type.IsStringInterface())) { |
| 4696 *value = CurrentLiteral()->raw(); | 4696 *value = CurrentLiteral()->raw(); |
| 4697 return true; | 4697 return true; |
| 4698 } else if ((CurrentToken() == Token::kTRUE) && | 4698 } else if ((CurrentToken() == Token::kTRUE) && |
| 4699 (no_check || type.IsBoolType())) { | 4699 (no_check || type.IsBoolType())) { |
| 4700 *value = Bool::True(); | 4700 *value = Bool::True(); |
| 4701 return true; | 4701 return true; |
| (...skipping 4538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9240 void Parser::SkipQualIdent() { | 9240 void Parser::SkipQualIdent() { |
| 9241 ASSERT(IsIdentifier()); | 9241 ASSERT(IsIdentifier()); |
| 9242 ConsumeToken(); | 9242 ConsumeToken(); |
| 9243 if (CurrentToken() == Token::kPERIOD) { | 9243 if (CurrentToken() == Token::kPERIOD) { |
| 9244 ConsumeToken(); // Consume the kPERIOD token. | 9244 ConsumeToken(); // Consume the kPERIOD token. |
| 9245 ExpectIdentifier("identifier expected after '.'"); | 9245 ExpectIdentifier("identifier expected after '.'"); |
| 9246 } | 9246 } |
| 9247 } | 9247 } |
| 9248 | 9248 |
| 9249 } // namespace dart | 9249 } // namespace dart |
| OLD | NEW |