OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/ast.h" | 8 #include "src/ast.h" |
9 #include "src/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 | 622 |
623 | 623 |
624 const AstRawString* ParserTraits::GetSymbol(Scanner* scanner) { | 624 const AstRawString* ParserTraits::GetSymbol(Scanner* scanner) { |
625 const AstRawString* result = | 625 const AstRawString* result = |
626 parser_->scanner()->CurrentSymbol(parser_->ast_value_factory_); | 626 parser_->scanner()->CurrentSymbol(parser_->ast_value_factory_); |
627 DCHECK(result != NULL); | 627 DCHECK(result != NULL); |
628 return result; | 628 return result; |
629 } | 629 } |
630 | 630 |
631 | 631 |
| 632 const AstRawString* ParserTraits::GetNumberAsSymbol(Scanner* scanner) { |
| 633 double double_value = parser_->scanner()->DoubleValue(); |
| 634 char array[100]; |
| 635 const char* string = |
| 636 DoubleToCString(double_value, Vector<char>(array, ARRAY_SIZE(array))); |
| 637 return ast_value_factory()->GetOneByteString(string); |
| 638 } |
| 639 |
| 640 |
632 const AstRawString* ParserTraits::GetNextSymbol(Scanner* scanner) { | 641 const AstRawString* ParserTraits::GetNextSymbol(Scanner* scanner) { |
633 return parser_->scanner()->NextSymbol(parser_->ast_value_factory_); | 642 return parser_->scanner()->NextSymbol(parser_->ast_value_factory_); |
634 } | 643 } |
635 | 644 |
636 | 645 |
637 Expression* ParserTraits::ThisExpression( | 646 Expression* ParserTraits::ThisExpression( |
638 Scope* scope, AstNodeFactory<AstConstructionVisitor>* factory, int pos) { | 647 Scope* scope, AstNodeFactory<AstConstructionVisitor>* factory, int pos) { |
639 return factory->NewVariableProxy(scope->receiver(), pos); | 648 return factory->NewVariableProxy(scope->receiver(), pos); |
640 } | 649 } |
641 | 650 |
(...skipping 4188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4830 info()->SetAstValueFactory(ast_value_factory_); | 4839 info()->SetAstValueFactory(ast_value_factory_); |
4831 } | 4840 } |
4832 ast_value_factory_ = NULL; | 4841 ast_value_factory_ = NULL; |
4833 | 4842 |
4834 InternalizeUseCounts(); | 4843 InternalizeUseCounts(); |
4835 | 4844 |
4836 return (result != NULL); | 4845 return (result != NULL); |
4837 } | 4846 } |
4838 | 4847 |
4839 } } // namespace v8::internal | 4848 } } // namespace v8::internal |
OLD | NEW |