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/parsing/parser.h" | 5 #include "src/parsing/parser.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/ast/ast-expression-rewriter.h" | 9 #include "src/ast/ast-expression-rewriter.h" |
10 #include "src/ast/ast-expression-visitor.h" | 10 #include "src/ast/ast-expression-visitor.h" |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 const AstRawString* result = | 595 const AstRawString* result = |
596 parser_->scanner()->CurrentSymbol(parser_->ast_value_factory()); | 596 parser_->scanner()->CurrentSymbol(parser_->ast_value_factory()); |
597 DCHECK(result != NULL); | 597 DCHECK(result != NULL); |
598 return result; | 598 return result; |
599 } | 599 } |
600 | 600 |
601 | 601 |
602 const AstRawString* ParserTraits::GetNumberAsSymbol(Scanner* scanner) { | 602 const AstRawString* ParserTraits::GetNumberAsSymbol(Scanner* scanner) { |
603 double double_value = parser_->scanner()->DoubleValue(); | 603 double double_value = parser_->scanner()->DoubleValue(); |
604 char array[100]; | 604 char array[100]; |
605 const char* string = | 605 const char* string = DoubleToCString(double_value, ArrayVector(array)); |
606 DoubleToCString(double_value, Vector<char>(array, arraysize(array))); | |
607 return parser_->ast_value_factory()->GetOneByteString(string); | 606 return parser_->ast_value_factory()->GetOneByteString(string); |
608 } | 607 } |
609 | 608 |
610 | 609 |
611 const AstRawString* ParserTraits::GetNextSymbol(Scanner* scanner) { | 610 const AstRawString* ParserTraits::GetNextSymbol(Scanner* scanner) { |
612 return parser_->scanner()->NextSymbol(parser_->ast_value_factory()); | 611 return parser_->scanner()->NextSymbol(parser_->ast_value_factory()); |
613 } | 612 } |
614 | 613 |
615 | 614 |
616 Expression* ParserTraits::ThisExpression(Scope* scope, AstNodeFactory* factory, | 615 Expression* ParserTraits::ThisExpression(Scope* scope, AstNodeFactory* factory, |
(...skipping 6179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6796 try_block, target); | 6795 try_block, target); |
6797 final_loop = target; | 6796 final_loop = target; |
6798 } | 6797 } |
6799 | 6798 |
6800 return final_loop; | 6799 return final_loop; |
6801 } | 6800 } |
6802 | 6801 |
6803 | 6802 |
6804 } // namespace internal | 6803 } // namespace internal |
6805 } // namespace v8 | 6804 } // namespace v8 |
OLD | NEW |